Skip to content

Commit 9cf6e9e

Browse files
author
Christopher J. Brody
committed
unit test bogus values of platforms with injection
1 parent 21d9163 commit 9cf6e9e

File tree

6 files changed

+423
-0
lines changed

6 files changed

+423
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`create alice-bobbi module with defaults, with platforms: 'bogus' 1`] = `
4+
Array [
5+
"* ensureDir dir: react-native-alice-bobbi
6+
",
7+
"* ensureDir dir: react-native-alice-bobbi/
8+
",
9+
"* ensureDir dir: react-native-alice-bobbi/
10+
",
11+
"* ensureDir dir: react-native-alice-bobbi/
12+
",
13+
"* ensureDir dir: react-native-alice-bobbi/
14+
",
15+
"* ensureDir dir: react-native-alice-bobbi/
16+
",
17+
"* ensureDir dir: react-native-alice-bobbi/
18+
",
19+
"* outputFile name: react-native-alice-bobbi/README.md
20+
content:
21+
--------
22+
# react-native-alice-bobbi
23+
24+
## Getting started
25+
26+
\`$ npm install react-native-alice-bobbi --save\`
27+
28+
### Mostly automatic installation
29+
30+
\`$ react-native link react-native-alice-bobbi\`
31+
32+
### Manual installation
33+
34+
35+
36+
## Usage
37+
\`\`\`javascript
38+
import AliceBobbi from 'react-native-alice-bobbi';
39+
40+
// TODO: What to do with the module?
41+
AliceBobbi;
42+
\`\`\`
43+
44+
<<<<<<<< ======== >>>>>>>>
45+
",
46+
"* outputFile name: react-native-alice-bobbi/package.json
47+
content:
48+
--------
49+
{
50+
\\"name\\": \\"react-native-alice-bobbi\\",
51+
\\"title\\": \\"React Native Alice Bobbi\\",
52+
\\"version\\": \\"1.0.0\\",
53+
\\"description\\": \\"TODO\\",
54+
\\"main\\": \\"index.js\\",
55+
\\"scripts\\": {
56+
\\"test\\": \\"echo \\\\\\"Error: no test specified\\\\\\" && exit 1\\"
57+
},
58+
\\"repository\\": {
59+
\\"type\\": \\"git\\",
60+
\\"url\\": \\"git+https://github.com/github_account/react-native-alice-bobbi.git\\",
61+
\\"baseUrl\\": \\"https://github.com/github_account/react-native-alice-bobbi\\"
62+
},
63+
\\"keywords\\": [
64+
\\"react-native\\"
65+
],
66+
\\"author\\": {
67+
\\"name\\": \\"Your Name\\",
68+
\\"email\\": \\"[email protected]\\"
69+
},
70+
\\"license\\": \\"MIT\\",
71+
\\"licenseFilename\\": \\"LICENSE\\",
72+
\\"readmeFilename\\": \\"README.md\\",
73+
\\"peerDependencies\\": {
74+
\\"react\\": \\"^16.8.1\\",
75+
\\"react-native\\": \\">=0.59.0-rc.0 <1.0.x\\"
76+
},
77+
\\"devDependencies\\": {
78+
\\"react\\": \\"^16.8.3\\",
79+
\\"react-native\\": \\"^0.59.10\\"
80+
}
81+
}
82+
83+
<<<<<<<< ======== >>>>>>>>
84+
",
85+
"* outputFile name: react-native-alice-bobbi/index.js
86+
content:
87+
--------
88+
import { NativeModules } from 'react-native';
89+
90+
const { AliceBobbi } = NativeModules;
91+
92+
export default AliceBobbi;
93+
94+
<<<<<<<< ======== >>>>>>>>
95+
",
96+
"* outputFile name: react-native-alice-bobbi/.gitignore
97+
content:
98+
--------
99+
# OSX
100+
#
101+
.DS_Store
102+
103+
# node.js
104+
#
105+
node_modules/
106+
npm-debug.log
107+
yarn-error.log
108+
109+
<<<<<<<< ======== >>>>>>>>
110+
",
111+
"* outputFile name: react-native-alice-bobbi/.gitattributes
112+
content:
113+
--------
114+
115+
<<<<<<<< ======== >>>>>>>>
116+
",
117+
"* outputFile name: react-native-alice-bobbi/.npmignore
118+
content:
119+
--------
120+
121+
<<<<<<<< ======== >>>>>>>>
122+
",
123+
]
124+
`;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const lib = require('../../../../../../lib/lib.js');
2+
3+
const ioInject = require('../../../../helpers/io-inject.js');
4+
5+
test(`create alice-bobbi module with defaults, with platforms: 'bogus'`, async () => {
6+
const mysnap = [];
7+
8+
const inject = ioInject(mysnap);
9+
10+
const options = {
11+
name: 'alice-bobbi',
12+
platforms: 'bogus'
13+
};
14+
15+
await lib(options, inject);
16+
expect(mysnap).toMatchSnapshot();
17+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`create alice-bobbi module with defaults, with bogus platforms: [] 1`] = `
4+
Array [
5+
"* ensureDir dir: react-native-alice-bobbi
6+
",
7+
"* ensureDir dir: react-native-alice-bobbi/
8+
",
9+
"* ensureDir dir: react-native-alice-bobbi/
10+
",
11+
"* ensureDir dir: react-native-alice-bobbi/
12+
",
13+
"* ensureDir dir: react-native-alice-bobbi/
14+
",
15+
"* ensureDir dir: react-native-alice-bobbi/
16+
",
17+
"* ensureDir dir: react-native-alice-bobbi/
18+
",
19+
"* outputFile name: react-native-alice-bobbi/README.md
20+
content:
21+
--------
22+
# react-native-alice-bobbi
23+
24+
## Getting started
25+
26+
\`$ npm install react-native-alice-bobbi --save\`
27+
28+
### Mostly automatic installation
29+
30+
\`$ react-native link react-native-alice-bobbi\`
31+
32+
### Manual installation
33+
34+
35+
36+
## Usage
37+
\`\`\`javascript
38+
import AliceBobbi from 'react-native-alice-bobbi';
39+
40+
// TODO: What to do with the module?
41+
AliceBobbi;
42+
\`\`\`
43+
44+
<<<<<<<< ======== >>>>>>>>
45+
",
46+
"* outputFile name: react-native-alice-bobbi/package.json
47+
content:
48+
--------
49+
{
50+
\\"name\\": \\"react-native-alice-bobbi\\",
51+
\\"title\\": \\"React Native Alice Bobbi\\",
52+
\\"version\\": \\"1.0.0\\",
53+
\\"description\\": \\"TODO\\",
54+
\\"main\\": \\"index.js\\",
55+
\\"scripts\\": {
56+
\\"test\\": \\"echo \\\\\\"Error: no test specified\\\\\\" && exit 1\\"
57+
},
58+
\\"repository\\": {
59+
\\"type\\": \\"git\\",
60+
\\"url\\": \\"git+https://github.com/github_account/react-native-alice-bobbi.git\\",
61+
\\"baseUrl\\": \\"https://github.com/github_account/react-native-alice-bobbi\\"
62+
},
63+
\\"keywords\\": [
64+
\\"react-native\\"
65+
],
66+
\\"author\\": {
67+
\\"name\\": \\"Your Name\\",
68+
\\"email\\": \\"[email protected]\\"
69+
},
70+
\\"license\\": \\"MIT\\",
71+
\\"licenseFilename\\": \\"LICENSE\\",
72+
\\"readmeFilename\\": \\"README.md\\",
73+
\\"peerDependencies\\": {
74+
\\"react\\": \\"^16.8.1\\",
75+
\\"react-native\\": \\">=0.59.0-rc.0 <1.0.x\\"
76+
},
77+
\\"devDependencies\\": {
78+
\\"react\\": \\"^16.8.3\\",
79+
\\"react-native\\": \\"^0.59.10\\"
80+
}
81+
}
82+
83+
<<<<<<<< ======== >>>>>>>>
84+
",
85+
"* outputFile name: react-native-alice-bobbi/index.js
86+
content:
87+
--------
88+
import { NativeModules } from 'react-native';
89+
90+
const { AliceBobbi } = NativeModules;
91+
92+
export default AliceBobbi;
93+
94+
<<<<<<<< ======== >>>>>>>>
95+
",
96+
"* outputFile name: react-native-alice-bobbi/.gitignore
97+
content:
98+
--------
99+
# OSX
100+
#
101+
.DS_Store
102+
103+
# node.js
104+
#
105+
node_modules/
106+
npm-debug.log
107+
yarn-error.log
108+
109+
<<<<<<<< ======== >>>>>>>>
110+
",
111+
"* outputFile name: react-native-alice-bobbi/.gitattributes
112+
content:
113+
--------
114+
115+
<<<<<<<< ======== >>>>>>>>
116+
",
117+
"* outputFile name: react-native-alice-bobbi/.npmignore
118+
content:
119+
--------
120+
121+
<<<<<<<< ======== >>>>>>>>
122+
",
123+
]
124+
`;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const lib = require('../../../../../../lib/lib.js');
2+
3+
const ioInject = require('../../../../helpers/io-inject.js');
4+
5+
test('create alice-bobbi module with defaults, with bogus platforms: []', async () => {
6+
const mysnap = [];
7+
8+
const inject = ioInject(mysnap);
9+
10+
const options = {
11+
name: 'alice-bobbi',
12+
platforms: []
13+
};
14+
15+
await lib(options, inject);
16+
expect(mysnap).toMatchSnapshot();
17+
});

0 commit comments

Comments
 (0)