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

Fix jasmine & jasmine-core requires in jasmine_runner.js #633

Merged
Merged
Changes from 1 commit
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
16 changes: 4 additions & 12 deletions packages/jasmine/src/jasmine_runner.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
const fs = require('fs');
const path = require('path');
const bazelJasmine = require('@bazel/jasmine');

const JasmineRunner = bazelJasmine.jasmine;

let jasmineCore = null
let JasmineRunner = require('jasmine/lib/jasmine');
if (global.jasmine) {
// global.jasmine has been initialized which means a bootstrap script
// has already required `jasmine-core` and called jasmineCore.boot()
jasmineCore = global.jasmineCore;
if (!jasmineCore) {
try {
// Try unhoisted jasmine-core first so that we don't
// need an @npm//jasmine-core dep in the unhoisted case.
jasmineCore = require('jasmine/node_modules/jasmine-core');
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') {
// rethrow other errors
throw e;
}
jasmineCore = require('jasmine-core');
}
jasmineCore = bazelJasmine.jasmineCore;
}
// Override the jasmineCore boot function so that the jasmine
// runner gets the already initialize jasmine and its shared environment
Expand Down