Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-npm

* Merges #198 from @lucaswerkmeister
* Fixes #197
  • Loading branch information
sgravrock committed Jun 16, 2022
2 parents 9d0222b + c5a7eeb commit fbaf707
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ async function runJasmine(jasmine, env, print) {
}

if (env.helpers !== undefined && env.helpers.length) {
jasmine.addHelperFiles(env.helpers);
jasmine.addMatchingHelperFiles(env.helpers);
}

if (env.requires !== undefined && env.requires.length) {
Expand Down
8 changes: 4 additions & 4 deletions spec/command_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('command', function() {

this.command = new Command(projectBaseDir, examplesDir, this.out.print);

this.fakeJasmine = jasmine.createSpyObj('jasmine', ['loadConfigFile', 'addHelperFiles', 'addRequires', 'showColors', 'execute',
this.fakeJasmine = jasmine.createSpyObj('jasmine', ['loadConfigFile', 'addMatchingHelperFiles', 'addRequires', 'showColors', 'execute',
'randomizeTests', 'seed', 'coreVersion', 'clearReporters', 'addReporter']);
this.fakeJasmine.loader = new Loader();
this.fakeJasmine.env = jasmine.createSpyObj('env', ['configure']);
Expand Down Expand Up @@ -243,17 +243,17 @@ describe('command', function() {

it('should be able to add one helper pattern', async function() {
await this.command.run(this.fakeJasmine, ['--helper=helpers/**/*.js']);
expect(this.fakeJasmine.addHelperFiles).toHaveBeenCalledWith(['helpers/**/*.js']);
expect(this.fakeJasmine.addMatchingHelperFiles).toHaveBeenCalledWith(['helpers/**/*.js']);
});

it('should be able to add many helper patterns', async function() {
await this.command.run(this.fakeJasmine, ['--helper=helpers/**/*.js', '--helper=other.js']);
expect(this.fakeJasmine.addHelperFiles).toHaveBeenCalledWith(['helpers/**/*.js', 'other.js']);
expect(this.fakeJasmine.addMatchingHelperFiles).toHaveBeenCalledWith(['helpers/**/*.js', 'other.js']);
});

it('should not modify helper patterns if no argument given', async function() {
await this.command.run(this.fakeJasmine, []);
expect(this.fakeJasmine.addHelperFiles).not.toHaveBeenCalled();
expect(this.fakeJasmine.addMatchingHelperFiles).not.toHaveBeenCalled();
});

it('should be able to add one require', async function() {
Expand Down

0 comments on commit fbaf707

Please sign in to comment.