Skip to content

Commit 5f7b19b

Browse files
committed
Fixed --require
Fixes #208
1 parent d0b93c4 commit 5f7b19b

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

lib/runner_base.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class RunnerBase {
211211
* @type string[] | undefined
212212
*/
213213
if(config.requires) {
214-
this.addRequires_(config.requires);
214+
this.addRequires(config.requires);
215215
}
216216

217217
/**
@@ -334,7 +334,7 @@ class RunnerBase {
334334
this.helperFiles.push(filePath);
335335
}
336336

337-
addRequires_(requires) {
337+
addRequires(requires) {
338338
const jasmineRunner = this;
339339
requires.forEach(function(r) {
340340
jasmineRunner.requires.push(r);

spec/fixtures/noisy_require.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('noisy require was loaded');

spec/integration_spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,16 @@ describe('Integration', function () {
508508
});
509509
}
510510
});
511+
512+
it('supports --require', async function() {
513+
const {exitCode, output} = await runJasmine(
514+
'spec/fixtures/sample_project',
515+
'spec/support/jasmine.json',
516+
['--require=../noisy_require.js']
517+
);
518+
expect(exitCode).toEqual(2); // because no specs
519+
expect(output).toContain('noisy require was loaded');
520+
});
511521
});
512522

513523
async function runJasmine(cwd, config="jasmine.json", extraArgs = []) {

0 commit comments

Comments
 (0)