diff --git a/scripts/babel-relay-plugin/package.json b/scripts/babel-relay-plugin/package.json index e49da0252786b..db9c46168a479 100644 --- a/scripts/babel-relay-plugin/package.json +++ b/scripts/babel-relay-plugin/package.json @@ -8,7 +8,7 @@ "scripts": { "build": "rm -rf lib; babel src --out-dir lib --ignore __tests__", "prepublish": "npm run build", - "test": "./testjs", + "test": "jest", "update-schema": "babel-node ./src/tools/generateSchemaJson.js", "update-fixtures": "babel-node ./src/tools/regenerateFixtures.js" }, @@ -20,11 +20,22 @@ ], "devDependencies": { "babel": "^5.8.23", - "jasmine-node": "1.14.5", + "babel-jest": "^5.3.0", + "jest-cli": "^0.5.8", "minimist": "^1.1.3" }, "dependencies": { "babel-core": "^5.8.25", "graphql": "0.4.2" + }, + "jest": { + "scriptPreprocessor": "/node_modules/babel-jest", + "persistModuleRegistryBetweenSpecs": true, + "preprocessorIgnorePatterns": [ + "/node_modules/" + ], + "unmockedModulePathPatterns": [ + "/" + ] } } diff --git a/scripts/babel-relay-plugin/testjs b/scripts/babel-relay-plugin/testjs deleted file mode 100755 index 2ff0916cb504c..0000000000000 --- a/scripts/babel-relay-plugin/testjs +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -cd "$(dirname "$0")" -JASMINE=node_modules/jasmine-node/bin/jasmine-node -if [ ! -x $JASMINE ] || [ ! -f $JASMINE ]; then - echo 'Jasmine is not installed. Run "npm install jasmine-node" from the "generator" directory' >&2 - exit 1 -else - CURRENT_DIR=`pwd` - NODE_PATHS="$CURRENT_DIR/src:$CURRENT_DIR/src/__tests__" - if [ -n "$NODE_PATH" ]; then - NODE_PATHS="$NODE_PATH:$NODE_PATHS" - fi - export NODE_PATH=$NODE_PATHS - echo 'Running core tests' - $JASMINE --captureExceptions --matchall src/__tests__/ -fi