From 1fc2db85fa339f9b134d45c15d2ad4cf3d681070 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 16 Jun 2016 03:06:08 -0700 Subject: [PATCH] web: fix tests --- web/package.json | 18 ++++++++---------- web/src/js/{tests => __tests__}/utils.js | 3 +-- 2 files changed, 9 insertions(+), 12 deletions(-) rename web/src/js/{tests => __tests__}/utils.js (89%) diff --git a/web/package.json b/web/package.json index 97a5ad3ea..54555cb1e 100644 --- a/web/package.json +++ b/web/package.json @@ -2,18 +2,16 @@ "name": "mitmproxy", "private": true, "scripts": { - "test": "jest ./src/js" + "test": "jest" }, "jest": { - "scriptPreprocessor": "/node_modules/babel-jest", "testPathDirs": [ - "./src/js" + "/src/js" ], - "testPathIgnorePatterns": [ - "/node_modules/", - "testutils.js" - ], - "testDirectoryName": "tests" + "unmockedModulePathPatterns": [ + "react", + "jquery" + ] }, "dependencies": { "bootstrap": "^3.3.6", @@ -33,7 +31,7 @@ "devDependencies": { "babel-core": "^6.7.7", "babel-eslint": "^6.0.4", - "babel-jest": "^12.0.2", + "babel-jest": "^12.1.0", "babel-plugin-transform-class-properties": "^6.6.0", "babel-plugin-transform-object-rest-spread": "^6.8.0", "babel-preset-es2015": "^6.6.0", @@ -52,7 +50,7 @@ "gulp-rename": "^1.2.2", "gulp-sourcemaps": "^1.6.0", "gulp-util": "^3.0.7", - "jest": "^0.1.40", + "jest": "^12.1.1", "uglifyify": "^3.0.1", "vinyl-buffer": "^1.0.0", "vinyl-source-stream": "^1.1.0", diff --git a/web/src/js/tests/utils.js b/web/src/js/__tests__/utils.js similarity index 89% rename from web/src/js/tests/utils.js rename to web/src/js/__tests__/utils.js index acbadc92e..eda740a17 100644 --- a/web/src/js/tests/utils.js +++ b/web/src/js/__tests__/utils.js @@ -1,5 +1,4 @@ -jest.dontMock("jquery"); -jest.dontMock("../utils"); +jest.unmock("../utils.js"); import {formatSize} from "../utils.js"