aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2018-09-30 08:25:25 +0300
committerValentin Popov <info@valentineus.link>2018-09-30 08:25:25 +0300
commitd41833472d369ed94958f75b8f1b777c60d2eabf (patch)
treea7718deacce62b29a93bab9388971bcd951b86c5
parentf969690944458c51aaa7be42b2f7a1ff70c55507 (diff)
downloadjs-github-library-d41833472d369ed94958f75b8f1b777c60d2eabf.tar.xz
js-github-library-d41833472d369ed94958f75b8f1b777c60d2eabf.zip
Settings for this testing environment
Signed-off-by: Valentin Popov <info@valentineus.link>
-rw-r--r--.eslintrc.json3
-rw-r--r--jest.config.js7
-rw-r--r--jest.setup.js3
-rw-r--r--jest.transform.js1
4 files changed, 14 insertions, 0 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
index b6af3aa..ae4e230 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -2,6 +2,7 @@
"env": {
"browser": true,
"es6": true,
+ "jest/globals": true,
"jquery": true,
"node": true
},
@@ -11,6 +12,7 @@
"jquery",
"plugin:import/errors",
"plugin:import/warnings",
+ "plugin:jest/recommended",
"plugin:node/recommended",
"plugin:promise/recommended",
"plugin:security/recommended",
@@ -21,6 +23,7 @@
"plugins": [
"compat",
"import",
+ "jest",
"no-loops",
"no-loops",
"no-use-extend-native",
diff --git a/jest.config.js b/jest.config.js
new file mode 100644
index 0000000..02ff019
--- /dev/null
+++ b/jest.config.js
@@ -0,0 +1,7 @@
+module.exports = {
+ browser: true,
+ clearMocks: true,
+ setupFiles: [ "./jest.setup.js" ],
+ testEnvironment: "jsdom",
+ transform: { "^.+\\.js$": "<rootDir>/jest.transform.js" }
+};
diff --git a/jest.setup.js b/jest.setup.js
new file mode 100644
index 0000000..353860a
--- /dev/null
+++ b/jest.setup.js
@@ -0,0 +1,3 @@
+import $ from "jquery";
+
+global.$ = global.jQuery = $;
diff --git a/jest.transform.js b/jest.transform.js
new file mode 100644
index 0000000..50bbbb5
--- /dev/null
+++ b/jest.transform.js
@@ -0,0 +1 @@
+module.exports = require("babel-jest").createTransformer({ presets: [ "es2015" ] });