inquirerer 0.1.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,176 +0,0 @@
1
- import { prompt, filter, _filter } from '../index';
2
- describe('arguments', () => {
3
- it('empty when all args supplied', () => {
4
- const questions = [
5
- {
6
- name: 'hello',
7
- message: 'hello',
8
- },
9
- {
10
- name: 'world',
11
- message: 'world',
12
- },
13
- ];
14
- const argv = {
15
- hello: 1,
16
- world: 2,
17
- };
18
- expect(filter(questions, argv)).toEqual([]);
19
- expect(argv).toEqual({
20
- hello: 1,
21
- world: 2,
22
- });
23
- });
24
- it('empty when all args supplied II', () => {
25
- const questions = [
26
- {
27
- _: true,
28
- name: 'foo',
29
- message: 'foo',
30
- },
31
- {
32
- name: 'bar',
33
- message: 'bar',
34
- },
35
- {
36
- _: true,
37
- name: 'baz',
38
- message: 'baz',
39
- },
40
- ];
41
- const argv = {
42
- _: [1, 3],
43
- bar: 2,
44
- };
45
-
46
- const _1 = filter(questions, argv);
47
- const _2 = _filter(questions, argv);
48
-
49
- expect(_2).toEqual({ _: [], bar: 2, baz: 3, foo: 1 });
50
- expect(argv).toEqual({
51
- _: [],
52
- foo: 1,
53
- bar: 2,
54
- baz: 3,
55
- });
56
- });
57
- it('init example', async () => {
58
- const questions = [
59
- {
60
- _: true,
61
- name: 'foo',
62
- message: '',
63
- },
64
- ];
65
- const argv = {
66
- _: [],
67
- bar: 2,
68
- };
69
- const _1 = _filter(questions, argv);
70
- const _2 = filter(questions, argv);
71
-
72
- expect(_2).toEqual([
73
- {
74
- _: true,
75
- name: 'foo',
76
- message: '',
77
- },
78
- ]);
79
- expect(argv).toEqual({
80
- _: [],
81
- bar: 2,
82
- });
83
- });
84
- it('basic example', async () => {
85
- const questions = [
86
- {
87
- name: 'name',
88
- message: 'project name (e.g., flipr)',
89
- required: true,
90
- },
91
- ];
92
- const argv = { _: [], cmd: 'init' };
93
- _filter(questions, argv);
94
- const _2 = filter(questions, argv);
95
- expect(_2).toEqual([
96
- {
97
- name: 'name',
98
- message: 'project name (e.g., flipr)',
99
- required: true,
100
- },
101
- ]);
102
- expect(argv).toEqual({ _: [], cmd: 'init' });
103
- });
104
- });
105
- describe('prompt', () => {
106
- it('empty when all args supplied', async () => {
107
- const questions = [
108
- {
109
- name: 'hello',
110
- message: '',
111
- },
112
- {
113
- name: 'world',
114
- message: '',
115
- },
116
- ];
117
- const argv = {
118
- hello: 1,
119
- world: 2,
120
- };
121
-
122
- const value = await prompt(questions, argv);
123
- expect(value).toEqual({
124
- hello: 1,
125
- world: 2,
126
- });
127
- });
128
- it('empty when all args supplied', async () => {
129
- const questions = [
130
- {
131
- _: true,
132
- name: 'foo',
133
- message: '',
134
- },
135
- {
136
- name: 'bar',
137
- message: '',
138
- },
139
- {
140
- _: true,
141
- name: 'baz',
142
- message: '',
143
- },
144
- ];
145
- const argv = {
146
- _: [1, 3],
147
- bar: 2,
148
- };
149
- const value = await prompt(questions, argv);
150
- expect(argv).toEqual({
151
- _: [],
152
- foo: 1,
153
- bar: 2,
154
- baz: 3,
155
- });
156
- expect(value).toEqual({
157
- _: [],
158
- foo: 1,
159
- bar: 2,
160
- baz: 3,
161
- });
162
- });
163
-
164
- it('basic example', async () => {
165
- const questions = [
166
- {
167
- name: 'cmd',
168
- message: 'project name (e.g., flipr)',
169
- required: true,
170
- },
171
- ];
172
- const argv = { _: [], cmd: 'init' };
173
- const value = await prompt(questions, argv);
174
- expect(value).toEqual(argv);
175
- });
176
- });
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "moduleResolution": "node",
4
- "target": "es5",
5
- "module": "umd",
6
- "lib": ["es2015", "es2016", "es2017", "dom"],
7
- "strict": true,
8
- "sourceMap": true,
9
- "declaration": true,
10
- "allowSyntheticDefaultImports": true,
11
- "experimentalDecorators": true,
12
- "emitDecoratorMetadata": true,
13
- "declarationDir": "build/types",
14
- "outDir": "build",
15
- "typeRoots": ["node_modules/@types"]
16
- },
17
- "include": ["/"]
18
- }