-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.ts
53 lines (41 loc) · 1.32 KB
/
index.test.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
import shellac from 'shellac'
import { dir } from 'tmp-promise'
import * as path from 'path'
describe('@fab/plugin-add-fab-id', () => {
it('should be installable from NPM', async () => {
const cwd = (await dir({ unsafeCleanup: true })).path
await shellac.in(cwd)`
$ yarn init -y && yarn
$$ npx fab init --empty -y
$$ yarn add @fab/plugin-add-fab-id
$ echo '${JSON.stringify({
plugins: {
'@fab/plugin-add-fab-id': {}
}
})}' > fab.config.json5
$$ yarn fab build
stdout >> ${build => expect(build).toMatch('Typecheck passed.')}
$ ls -l
stdout >> ${files => expect(files).toMatch('fab.zip')}
`
}, 500000)
it('should be buildable locally', async () => {
const cwd = (await dir({ unsafeCleanup: true })).path
await shellac.in(cwd)`
$$ pwd
$ yarn init -y && yarn
$$ npx fab init --empty -y
$ cp ${path.join(__dirname, 'index.ts')} plugin.ts
$ echo '${JSON.stringify({
plugins: {
'./plugin.ts': {}
}
})}' > fab.config.json5
$$ cat fab.config.json5
$$ yarn fab build
stdout >> ${build => expect(build).toMatch('Typecheck passed.')}
$ ls -l
stdout >> ${files => expect(files).toMatch('fab.zip')}
`
}, 500000)
})