Skip to content

Commit

Permalink
chore: Setup jest environment
Browse files Browse the repository at this point in the history
  • Loading branch information
MagnunAVFAzion committed Jun 28, 2023
1 parent d291b05 commit db5af15
Show file tree
Hide file tree
Showing 5 changed files with 2,570 additions and 100 deletions.
12 changes: 12 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
}
84 changes: 21 additions & 63 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,84 +1,42 @@
{
"env": {
"browser": true,
"es2021": true
"es2021": true,
"jest/globals": true
},
"plugins": [
"jsdoc"
],
"plugins": ["jsdoc", "jest"],
"extends": [
"airbnb-base",
"plugin:jsdoc/recommended"
"plugin:jsdoc/recommended",
"plugin:jest/recommended"
],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
"sourceType": "module"
},
"settings": {
"import/resolver": {
"alias": {
"map": [
[
"#root/*",
"./"
],
[
"#lib/*",
"./lib"
],
[
"#utils",
"./lib/utils/index.js"
],
[
"#polyfills",
"./lib/build/polyfills/index.js"
],
[
"#build",
"./lib/build/dispatcher/index.js"
],
[
"#bundlers",
"./lib/build/bundlers/index.js"
],
[
"#types",
"./lib/types/index.js"
],
[
"#preset/*",
"./lib/presets"
],
[
"#env",
"./lib/env/index.js"
],
[
"#platform",
"./lib/platform/index.js"
],
[
"#constants",
"./lib/constants/index.js"
],
[
"#edge",
"./lib/platform/edgehooks/index.js"
]
["#root/*", "./"],
["#lib/*", "./lib"],
["#utils", "./lib/utils/index.js"],
["#polyfills", "./lib/build/polyfills/index.js"],
["#build", "./lib/build/dispatcher/index.js"],
["#bundlers", "./lib/build/bundlers/index.js"],
["#types", "./lib/types/index.js"],
["#preset/*", "./lib/presets"],
["#env", "./lib/env/index.js"],
["#platform", "./lib/platform/index.js"],
["#constants", "./lib/constants/index.js"],
["#edge", "./lib/platform/edgehooks/index.js"]
],
"extensions": [
".js",
".json"
]
"extensions": [".js", ".json"]
}
}
},
"rules": {
"import/extensions": [
"error",
"always"
]
"import/extensions": ["error", "always"]
}
}
}
6 changes: 6 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
transform: {
'^.+\\.(js|jsx)?$': 'babel-jest',
},
testEnvironment: 'node',
};
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"start": "node lib/main.js",
"task:aliases": "node tasks/sync-aliases.js",
"task:docs": "jsdoc --configure jsdoc.json --verbose",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "jest",
"test:watch": "jest --watch"
},
"author": "",
"license": "MIT",
Expand All @@ -32,12 +33,18 @@
"webpack-merge": "^5.9.0"
},
"devDependencies": {
"@babel/core": "^7.22.5",
"@babel/preset-env": "^7.22.5",
"@jest/globals": "^29.5.0",
"babel-jest": "^29.5.0",
"clean-jsdoc-theme": "^4.2.9",
"eslint": "^7.32.0 || ^8.2.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jsdoc": "^44.2.5"
"eslint-plugin-jest": "^27.2.2",
"eslint-plugin-jsdoc": "^44.2.5",
"jest": "^29.5.0"
},
"imports": {
"#root/*": "./",
Expand Down
Loading

0 comments on commit db5af15

Please sign in to comment.