Moves test runner logic to helper (#3041)
This commit is contained in:
@@ -65,7 +65,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "npm run build && node bin/dev",
|
"dev": "npm run build && node bin/dev",
|
||||||
"build": "babel src/ -d lib/",
|
"build": "babel src/ -d lib/",
|
||||||
"test": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 node $COVERAGE_OPTION ./spec/support/runner.js",
|
"test": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 $COVERAGE_OPTION jasmine",
|
||||||
"test:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 node ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
|
"test:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 node ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
|
||||||
"coverage": "cross-env COVERAGE_OPTION='./node_modules/.bin/istanbul cover' npm test",
|
"coverage": "cross-env COVERAGE_OPTION='./node_modules/.bin/istanbul cover' npm test",
|
||||||
"coverage:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 node ./node_modules/babel-istanbul/lib/cli.js cover ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
|
"coverage:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 node ./node_modules/babel-istanbul/lib/cli.js cover ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
"use strict"
|
"use strict"
|
||||||
// Sets up a Parse API server for testing.
|
// Sets up a Parse API server for testing.
|
||||||
|
const SpecReporter = require('jasmine-spec-reporter');
|
||||||
|
|
||||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 5000;
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 5000;
|
||||||
|
|
||||||
|
jasmine.getEnv().clearReporters();
|
||||||
|
jasmine.getEnv().addReporter(new SpecReporter());
|
||||||
|
|
||||||
global.on_db = (db, callback, elseCallback) => {
|
global.on_db = (db, callback, elseCallback) => {
|
||||||
if (process.env.PARSE_SERVER_TEST_DB == db) {
|
if (process.env.PARSE_SERVER_TEST_DB == db) {
|
||||||
return callback();
|
return callback();
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
var Jasmine = require('jasmine');
|
|
||||||
var SpecReporter = require('jasmine-spec-reporter');
|
|
||||||
|
|
||||||
var jrunner = new Jasmine();
|
|
||||||
jrunner.env.clearReporters(); // jasmine >= 2.5.2, remove default reporter logs
|
|
||||||
jrunner.addReporter(new SpecReporter()); // add jasmine-spec-reporter
|
|
||||||
jrunner.loadConfigFile(); // load jasmine.json configuration
|
|
||||||
jrunner.execute();
|
|
||||||
Reference in New Issue
Block a user