-
-
Notifications
You must be signed in to change notification settings - Fork 644
/
Copy pathinspect_rcfile.spec.ts
54 lines (49 loc) · 1.4 KB
/
inspect_rcfile.spec.ts
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
46
47
48
49
50
51
52
53
54
/*
* @adonisjs/core
*
* (c) AdonisJS
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { test } from '@japa/runner'
import { AceFactory } from '../../factories/core/ace.js'
import InspectRCFile from '../../commands/inspect_rcfile.js'
test.group('Inspect RCFile', () => {
test('inspect rcfile contents', async ({ assert, fs }) => {
const ace = await new AceFactory().make(fs.baseUrl)
await ace.app.init()
ace.ui.switchMode('raw')
const inspect = await ace.create(InspectRCFile, [])
await inspect.exec()
inspect.assertSucceeded()
const { raw, providers, preloads, commands, ...rcContents } = ace.app.rcFile
assert.deepEqual(ace.ui.logger.getLogs(), [
{
message: JSON.stringify(
{
...rcContents,
providers: providers.map((provider) => {
return {
...provider,
file: provider.file.toString(),
}
}),
preloads: preloads.map((preload) => {
return {
...preload,
file: preload.file.toString(),
}
}),
commands: commands.map((command) => {
return command.toString()
}),
},
null,
2
),
stream: 'stdout',
},
])
})
})