Skip to content

Commit 9c538c3

Browse files
author
Nick Balestra
committed
snapshot wip
1 parent dad5ccf commit 9c538c3

File tree

4 files changed

+52
-1
lines changed

4 files changed

+52
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
}
2626
},
2727
"standard": {
28-
"globals": [ "describe", "test", "it", "expect", "jest" ]
28+
"globals": [ "describe", "test", "it", "expect", "jest", "beforeEach", "afterEach" ]
2929
},
3030
"devDependencies": {
3131
"ghooks": "^2.0.0",

packages/create-cycle-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"minimist": "^1.2.0"
1818
},
1919
"devDependencies": {
20+
"fs-extra": "^2.0.0",
2021
"jest": "^18.1.0"
2122
},
2223
"repository": {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
exports[`create-cycle-app 1`] = `
2+
"{
3+
\"name\": \"MYCYCLEAPP\",
4+
\"version\": \"0.1.0\",
5+
\"private\": true,
6+
\"devDependencies\": {
7+
\"cycle-scripts\": \"1.0.2\"
8+
},
9+
\"dependencies\": {},
10+
\"scripts\": {
11+
\"start\": \"cycle-scripts start\",
12+
\"test\": \"cycle-scripts test\",
13+
\"build\": \"cycle-scripts build\",
14+
\"eject\": \"cycle-scripts eject\"
15+
},
16+
\"babel\": {
17+
\"presets\": [
18+
\"es2015\"
19+
]
20+
}
21+
}"
22+
`;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const fs = require('fs-extra')
2+
const path = require('path')
3+
const appName = path.resolve(__dirname, 'MYCYCLEAPP')
4+
const spawn = require('cross-spawn')
5+
6+
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()
27+
})
28+
})

0 commit comments

Comments
 (0)