Skip to content

Commit 8500a14

Browse files
committed
Move files
1 parent be482e3 commit 8500a14

File tree

7 files changed

+544
-4
lines changed

7 files changed

+544
-4
lines changed

test/ava.js renamed to test/options/ava.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ if (OPTIONS === undefined) {
1717
} else {
1818
// We do not require `./helpers` so that `./helpers/remove` is not executed.
1919
// eslint-disable-next-line import/no-unassigned-import
20-
require('./helpers/testing/ava')
20+
require('../helpers/testing/ava')
2121
}

test/options.js renamed to test/options/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const test = require('ava')
44
const sinon = require('sinon')
55

6-
const { startLogging, normalizeMessage } = require('./helpers')
6+
const { startLogging, normalizeMessage } = require('../helpers')
77

88
const INVALID_OPTIONS = [
99
{ log: true },
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
# Snapshot report for `test/options/options.js`
2+
3+
The actual snapshot is saved in `options.js.snap`.
4+
5+
Generated by [AVA](https://ava.li).
6+
7+
## {"colors":1} should validate options
8+
9+
> Snapshot 1
10+
11+
`● Validation Error:␊
12+
13+
Option "colors" must be of type:␊
14+
boolean␊
15+
but instead received:␊
16+
number␊
17+
18+
Example:␊
19+
{␊
20+
"colors": true␊
21+
}`
22+
23+
## {"exitOn":["invalid"]} should validate options
24+
25+
> Snapshot 1
26+
27+
'Invalid option \'exitOn\' \'invalid\': must be one of uncaughtException, unhandledRejection, rejectionHandled, multipleResolves, warning'
28+
29+
## {"exitOn":true} should validate options
30+
31+
> Snapshot 1
32+
33+
`● Validation Error:␊
34+
35+
Option "exitOn" must be of type:␊
36+
array␊
37+
but instead received:␊
38+
boolean␊
39+
40+
Example:␊
41+
{␊
42+
"exitOn": [␊
43+
"uncaughtException"␊
44+
]␊
45+
}`
46+
47+
## {"level":"invalid"} should validate options
48+
49+
> Snapshot 1
50+
51+
`● Validation Error:␊
52+
53+
Option "level" must be of type:␊
54+
object␊
55+
but instead received:␊
56+
string␊
57+
58+
Example:␊
59+
{␊
60+
"level": {␊
61+
"default": [␊
62+
"error",␊
63+
null␊
64+
],␊
65+
"uncaughtException": [␊
66+
"error",␊
67+
null␊
68+
],␊
69+
"warning": [␊
70+
"warn",␊
71+
null␊
72+
],␊
73+
"unhandledRejection": [␊
74+
"error",␊
75+
null␊
76+
],␊
77+
"rejectionHandled": [␊
78+
"error",␊
79+
null␊
80+
],␊
81+
"multipleResolves": [␊
82+
"info",␊
83+
null␊
84+
]␊
85+
}␊
86+
}`
87+
88+
## {"level":true} should validate options
89+
90+
> Snapshot 1
91+
92+
`● Validation Error:␊
93+
94+
Option "level" must be of type:␊
95+
object␊
96+
but instead received:␊
97+
boolean␊
98+
99+
Example:␊
100+
{␊
101+
"level": {␊
102+
"default": [␊
103+
"error",␊
104+
null␊
105+
],␊
106+
"uncaughtException": [␊
107+
"error",␊
108+
null␊
109+
],␊
110+
"warning": [␊
111+
"warn",␊
112+
null␊
113+
],␊
114+
"unhandledRejection": [␊
115+
"error",␊
116+
null␊
117+
],␊
118+
"rejectionHandled": [␊
119+
"error",␊
120+
null␊
121+
],␊
122+
"multipleResolves": [␊
123+
"info",␊
124+
null␊
125+
]␊
126+
}␊
127+
}`
128+
129+
## {"level":{"unknown":"error"}} should warn on options
130+
131+
> Snapshot 1
132+
133+
`● Validation Warning:␊
134+
135+
Unknown option "level.unknown" with value "error" was found.␊
136+
This is probably a typing mistake. Fixing it will remove this message.`
137+
138+
## {"level":{"warning":"invalid"}} should validate options
139+
140+
> Snapshot 1
141+
142+
'Invalid option \'level.warning\' \'invalid\': must be a function or one of debug, info, warn, error, silent, default'
143+
144+
## {"level":{"warning":true}} should validate options
145+
146+
> Snapshot 1
147+
148+
`● Validation Error:␊
149+
150+
Option "level.warning" must be of type:␊
151+
string or function␊
152+
but instead received:␊
153+
boolean␊
154+
155+
Example:␊
156+
{␊
157+
"warning": "warn"␊
158+
}␊
159+
160+
or␊
161+
162+
{␊
163+
"warning":()=>{}␊
164+
}`
165+
166+
## {"log":true} should validate options
167+
168+
> Snapshot 1
169+
170+
`● Validation Error:␊
171+
172+
Option "log" must be of type:␊
173+
function␊
174+
but instead received:␊
175+
boolean␊
176+
177+
Example:␊
178+
{␊
179+
"log": function(){}␊
180+
}`
181+
182+
## {"message":true} should validate options
183+
184+
> Snapshot 1
185+
186+
`● Validation Error:␊
187+
188+
Option "message" must be of type:␊
189+
function␊
190+
but instead received:␊
191+
boolean␊
192+
193+
Example:␊
194+
{␊
195+
"message": function(){}␊
196+
}`
197+
198+
## {"testing":"ava"} should validate options
199+
200+
> Snapshot 1
201+
202+
'Invalid option \'log\': it must not be defined together with the option \'testing\' \'ava\''
203+
204+
## {"testing":"invalid"} should validate options
205+
206+
> Snapshot 1
207+
208+
'Invalid option \'testing\' \'invalid\': must be one of ava'
209+
210+
## {"testing":true} should validate options
211+
212+
> Snapshot 1
213+
214+
`● Validation Error:␊
215+
216+
Option "testing" must be of type:␊
217+
string␊
218+
but instead received:␊
219+
boolean␊
220+
221+
Example:␊
222+
{␊
223+
"testing": "ava"␊
224+
}`
225+
226+
## {"unknown":true} should warn on options
227+
228+
> Snapshot 1
229+
230+
`● Validation Warning:␊
231+
232+
Unknown option "unknown" with value true was found.␊
233+
This is probably a typing mistake. Fixing it will remove this message.`
1.05 KB
Binary file not shown.

0 commit comments

Comments
 (0)