-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
45 lines (41 loc) · 1.14 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
'use strict';
import path from 'path';
import test from 'ava';
import helpers from 'yeoman-test';
import assert from 'yeoman-assert';
test.serial('Test standard scaffold', async t => {
await helpers
.run(path.join(__dirname, '/app'))
.withPrompts({
componentNameRaw: 'helloWorld',
githubUsername: 'tester',
website: 'helloworld',
prefixReactNative: true
});
// Core Code Intact
t.notThrows(() => assert.file([
'.babelrc',
'.gitignore',
'.travis.yml',
'__tests__/Hello-World.test.js',
'components/Hello-World.js',
'LICENSE',
'package.json',
'readme.md'
]));
// Tpl Assertions
t.notThrows(() => assert.fileContent([
['__tests__/Hello-World.test.js', /helloWorld/],
['components/Hello-World.js', /helloWorld/],
['package.json', /react-native-hello-world/],
['readme.md', /https:\/\/img.shields.io\/travis\/tester\/react-native-hello-world.svg/]
]));
// Check to see no strangling template tags
t.notThrows(() => assert.noFileContent([
['__tests__/Hello-World.test.js', /<%.*%>/],
['components/Hello-World.js', /<%.*%>/],
['lICENSE', /<%.*%>/],
['package.json', /<%.*%>/],
['readme.md', /<%.*%>/]
]));
});