feat(cli): refactor cli build
This commit is contained in:
parent
b3446092d0
commit
4c3fe26478
36 changed files with 486 additions and 313 deletions
examples
napi-compat-mode/__test__
napi/__test__
|
@ -14,7 +14,7 @@ test('should read a file and return its a buffer', async (t) => {
|
|||
t.is(bindings.testTokioReadfile, undefined)
|
||||
return
|
||||
}
|
||||
await new Promise((resolve, reject) => {
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
bindings.testTokioReadfile(filepath, (err: Error | null, value: Buffer) => {
|
||||
try {
|
||||
t.is(err, null)
|
||||
|
|
|
@ -28,7 +28,7 @@ test.serial('should reject error from tokio future', async (t) => {
|
|||
await bindings.testTokioError(filepath)
|
||||
throw new TypeError('Unreachable')
|
||||
} catch (e) {
|
||||
t.is(e.message, 'Error from tokio future')
|
||||
t.is((e as Error).message, 'Error from tokio future')
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ test('should be able to detach ArrayBuffer', (t) => {
|
|||
bindings.testDetachArrayBuffer(ab)
|
||||
t.is(ab.byteLength, 0)
|
||||
} catch (e) {
|
||||
t.is(e.code, 'DetachableArraybufferExpected')
|
||||
t.is((e as any).code, 'DetachableArraybufferExpected')
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -28,6 +28,6 @@ test('is detached arraybuffer should work fine', (t) => {
|
|||
t.false(bindings.testIsDetachedArrayBuffer(nonDetachedArrayBuffer))
|
||||
t.true(bindings.testIsDetachedArrayBuffer(detachedArrayBuffer))
|
||||
} catch (e) {
|
||||
t.is(e.code, 'DetachableArraybufferExpected')
|
||||
t.is((e as any).code, 'DetachableArraybufferExpected')
|
||||
}
|
||||
})
|
||||
|
|
|
@ -9,6 +9,11 @@ Generated by [AVA](https://avajs.dev).
|
|||
> Snapshot 1
|
||||
|
||||
[
|
||||
'@rollup/plugin-alias',
|
||||
'@rollup/plugin-commonjs',
|
||||
'@rollup/plugin-json',
|
||||
'@rollup/plugin-node-resolve',
|
||||
'@rollup/plugin-replace',
|
||||
'@types/debug',
|
||||
'@types/lodash-es',
|
||||
'@types/node',
|
||||
|
@ -29,6 +34,7 @@ Generated by [AVA](https://avajs.dev).
|
|||
'lint-staged',
|
||||
'npm-run-all',
|
||||
'prettier',
|
||||
'rollup',
|
||||
'shx',
|
||||
'sinon',
|
||||
'source-map-support',
|
||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue