Skip to content

Commit 709c15c

Browse files
committed
build: fix mocha config, prettier glob
1 parent c62c8c4 commit 709c15c

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"lint": "eslint $npm_package_config_lint",
99
"lint:fix": "eslint $npm_package_config_lint",
1010
"lint:watch": "esw --watch $npm_package_config_lint",
11-
"prettier": "prettier --write $npm_package_config_prettier",
12-
"prettier:check": "prettier --list-different $npm_package_config_prettier",
11+
"prettier": "prettier --write .babelrc.js *.json *.md *.ts '{src,test}/**/*.{js,ts}'",
12+
"prettier:check": "prettier --list-different .babelrc.js *.json *.md *.ts '{src,test}/**/*.{js,ts}'",
1313
"tsc": "tsc --noEmit",
1414
"tsc:watch": "npm run tsc -- --watch",
1515
"clean": "rimraf es lib $(cd src; ls) *.js *.d.ts",
@@ -25,9 +25,8 @@
2525
"semantic-release": "semantic-release"
2626
},
2727
"config": {
28-
"lint": "--cache --ext .ts src test",
29-
"prettier": ".babelrc.js *.json *.md *.ts '{src,test}/**/*.ts'",
30-
"mocha": "-r @babel/register test/configure.ts 'test/**/*.ts' 'src/**/*.spec.ts'",
28+
"lint": "--cache --ext .js,.ts src test",
29+
"mocha": "-r test/configure.js 'src/**/*.spec.ts'",
3130
"commitizen": {
3231
"path": "cz-conventional-changelog"
3332
}

src/index.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* eslint-env mocha */
2+
3+
describe('test setup', () => {
4+
it('works', () => {})
5+
})

test/configure.ts renamed to test/configure.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
/* eslint-env node */
1+
/* eslint-disable */
2+
3+
const { before } = require('mocha')
4+
require('@babel/register')({ extensions: ['.js', '.ts'] })
25

36
if (process.argv.indexOf('--watch') >= 0) {
47
before(() => process.stdout.write('\u001b[2J\u001b[1;1H\u001b[3J'))

0 commit comments

Comments
 (0)