Skip to content

Commit

Permalink
setup babel for testing(jest)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronchen committed Jun 3, 2021
1 parent d516b35 commit 75bf0b5
Show file tree
Hide file tree
Showing 9 changed files with 17,118 additions and 9,422 deletions.
13 changes: 13 additions & 0 deletions babel.config.js
@@ -0,0 +1,13 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: '14',
},
},
],
'@babel/preset-typescript',
],
};
26,493 changes: 17,082 additions & 9,411 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion package.json
Expand Up @@ -4,21 +4,27 @@
"scripts": {
"build": "tsc -b .",
"lint": "lerna run lint",
"clean": "lerna run clean"
"clean": "lerna run clean",
"test": "lerna run test"
},
"devDependencies": {
"@babel/preset-env": "^7.14.4",
"@babel/preset-typescript": "^7.13.0",
"@types/jest": "^26.0.23",
"@types/node": "^15.9.0",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"eslint": "^7.27.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"jest": "^27.0.4",
"lerna": "^4.0.0",
"prettier": "2.3.0",
"rimraf": "^3.0.2",
Expand Down
3 changes: 3 additions & 0 deletions packages/components/.babelrc
@@ -0,0 +1,3 @@
{
"extends": "../../babel.config.js"
}
8 changes: 4 additions & 4 deletions packages/components/__tests__/components.test.ts
@@ -1,7 +1,7 @@
'use strict';

const components = require('..');
import components from '../src';

describe('@mono-react-component-template/components', () => {
it('needs tests');
it('needs tests', () => {
expect(components('foo', 'bar')).toBe('foobar');
});
});
2 changes: 1 addition & 1 deletion packages/components/package.json
Expand Up @@ -20,6 +20,6 @@
"scripts": {
"lint": "eslint src --ext js,ts,jsx,tsx",
"clean": "rimraf dist *.tsbuildinfo",
"test": "echo \"Error: run tests from root\" && exit 1"
"test": "jest"
}
}
3 changes: 3 additions & 0 deletions packages/core/.babelrc
@@ -0,0 +1,3 @@
{
"extends": "../../babel.config.js"
}
8 changes: 4 additions & 4 deletions packages/core/__tests__/core.test.ts
@@ -1,7 +1,7 @@
'use strict';

const core = require('..');
import core from '../src';

describe('@mono-react-component-template/core', () => {
it('needs tests');
it('needs tests', () => {
expect(core('foo', 'bar')).toBe('foobar');
});
});
2 changes: 1 addition & 1 deletion packages/core/package.json
Expand Up @@ -20,6 +20,6 @@
"scripts": {
"lint": "eslint src --ext js,ts,jsx,tsx",
"clean": "rimraf dist *.tsbuildinfo",
"test": "echo \"Error: run tests from root\" && exit 1"
"test": "jest"
}
}

0 comments on commit 75bf0b5

Please sign in to comment.