ci: write ava.config for ava@2
This commit is contained in:
parent
826ebd9847
commit
24919d72be
4 changed files with 27 additions and 0 deletions
|
@ -5,6 +5,7 @@ parserOptions:
|
||||||
jsx: true
|
jsx: true
|
||||||
ecmaVersion: 2020
|
ecmaVersion: 2020
|
||||||
sourceType: module
|
sourceType: module
|
||||||
|
extraFileExtensions: ['.cjs']
|
||||||
project: ./tsconfig.json
|
project: ./tsconfig.json
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
@ -220,3 +221,10 @@ overrides:
|
||||||
- '@typescript-eslint'
|
- '@typescript-eslint'
|
||||||
parserOptions:
|
parserOptions:
|
||||||
project: ./bench/tsconfig.json
|
project: ./bench/tsconfig.json
|
||||||
|
|
||||||
|
- files:
|
||||||
|
- ./*.{cjs,js}
|
||||||
|
plugins:
|
||||||
|
- '@typescript-eslint'
|
||||||
|
parserOptions:
|
||||||
|
project: ./tsconfig.root-lint.json
|
||||||
|
|
5
.github/workflows/napi3.yaml
vendored
5
.github/workflows/napi3.yaml
vendored
|
@ -73,6 +73,11 @@ jobs:
|
||||||
command: test
|
command: test
|
||||||
args: -p napi-sys --lib -- --nocapture
|
args: -p napi-sys --lib -- --nocapture
|
||||||
|
|
||||||
|
- name: Write ava.config.js for ava@2
|
||||||
|
run: |
|
||||||
|
node write-ava-config.js
|
||||||
|
cat ava.config.js
|
||||||
|
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
run: |
|
run: |
|
||||||
yarn --cwd ./test_module --ignore-engines build
|
yarn --cwd ./test_module --ignore-engines build
|
||||||
|
|
4
tsconfig.root-lint.json
Normal file
4
tsconfig.root-lint.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"files": ["./ava.config.cjs", "./write-ava-config.js"]
|
||||||
|
}
|
10
write-ava-config.js
Normal file
10
write-ava-config.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
const { writeFileSync } = require('fs')
|
||||||
|
const { join } = require('path')
|
||||||
|
|
||||||
|
const config = require('./ava.config.cjs')
|
||||||
|
|
||||||
|
const code = `
|
||||||
|
export default ${JSON.stringify(config, null, 2)}
|
||||||
|
`
|
||||||
|
|
||||||
|
writeFileSync(join(__dirname, 'ava.config.js'), code)
|
Loading…
Reference in a new issue