Skip to content

Commit f9cc35d

Browse files
author
Nick Balestra
committed
test cleanup
1 parent 9c538c3 commit f9cc35d

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
lines changed

packages/create-cycle-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "3.0.1",
44
"description": "Create Cycle.js with no build configuration.",
55
"scripts": {
6-
"test": "jest"
6+
"test": "jest --verbose"
77
},
88
"keywords": [],
99
"author": "Geovani Souza <geovanisouza92@gmail.com>",

packages/create-cycle-app/test/integration/__snapshots__/createCycleApp.spec.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports[`create-cycle-app 1`] = `
1+
exports[`create-cycle-app when invoked with the a directory it generate a correct package.json file 1`] = `
22
"{
33
\"name\": \"MYCYCLEAPP\",
44
\"version\": \"0.1.0\",

packages/create-cycle-app/test/integration/createCycleApp.spec.js

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,34 @@ const appName = path.resolve(__dirname, 'MYCYCLEAPP')
44
const spawn = require('cross-spawn')
55

66
describe('create-cycle-app', () => {
7-
afterEach(() => {
8-
fs.removeSync(appName)
9-
})
10-
beforeEach((done) => {
11-
spawn.sync('node', [
12-
path.resolve(__dirname, '../../index.js'),
13-
appName
14-
])
15-
done()
16-
})
17-
test('', () => {
18-
const dir = fs.readdirSync(appName)
19-
expect(dir).toMatchObject([
20-
'.gitignore',
21-
'node_modules',
22-
'package.json',
23-
'public',
24-
'src'
25-
])
26-
expect(fs.readFileSync(path.join(appName, 'package.json'), 'UTF8')).toMatchSnapshot()
7+
describe('when invoked with the a directory', () => {
8+
let dir
9+
10+
beforeEach((done) => {
11+
spawn.sync('node', [
12+
path.resolve(__dirname, '../../index.js'),
13+
appName
14+
])
15+
dir = fs.readdirSync(appName)
16+
done()
17+
})
18+
19+
afterEach(() => {
20+
fs.removeSync(appName)
21+
})
22+
23+
test('it generate the correct folder structure and install dependencies', () => {
24+
expect(dir).toMatchObject([
25+
'.gitignore',
26+
'node_modules',
27+
'package.json',
28+
'public',
29+
'src'
30+
])
31+
})
32+
33+
test('it generate a correct package.json file', () => {
34+
expect(fs.readFileSync(path.join(appName, 'package.json'), 'UTF8')).toMatchSnapshot()
35+
})
2736
})
2837
})

0 commit comments

Comments
 (0)