Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork Jasmine #3147

Merged
merged 7 commits into from
Mar 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
**/coverage/**
**/node_modules/**
**/vendor/**
bin/
docs/
flow-typed/**
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"!**/bin/**",
"!**/cli/**",
"!**/perf/**",
"!**/vendor/**",
"!**/__mocks__/**",
"!**/__tests__/**",
"!integration_tests/**"
Expand Down
17 changes: 4 additions & 13 deletions packages/jest-jasmine2/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,9 @@ import type Runtime from 'jest-runtime';
const JasmineReporter = require('./reporter');

const jasmineAsync = require('./jasmine-async');
const fs = require('graceful-fs');
const path = require('path');
const vm = require('vm');

const JASMINE_PATH = require.resolve('../vendor/jasmine-2.5.2.js');

const jasmineScript = new vm.Script(fs.readFileSync(JASMINE_PATH, 'utf8'), {
displayErrors: true,
filename: JASMINE_PATH,
});
const JASMINE = require.resolve('./jasmine-light.js');

function jasmine2(
config: Config,
Expand All @@ -35,13 +28,11 @@ function jasmine2(
testPath: string,
): Promise<TestResult> {
const reporter = new JasmineReporter(config, environment, testPath);
environment.runScript(jasmineScript);

const requireJasmine = environment.global.jasmineRequire;
const jasmine = requireJasmine.core(requireJasmine);
const jasmineFactory = runtime.requireInternalModule(JASMINE);
const jasmine = jasmineFactory.create();

const env = jasmine.getEnv();
const jasmineInterface = requireJasmine.interface(jasmine, env);
const jasmineInterface = jasmineFactory.interface(jasmine, env);
Object.assign(environment.global, jasmineInterface);
env.addReporter(jasmineInterface.jsApiReporter);

Expand Down
Loading