Skip to content

Commit

Permalink
Decoupled specs in jasmine_spec from other spec files
Browse files Browse the repository at this point in the history
  • Loading branch information
sgravrock committed Oct 24, 2020
1 parent ac70f33 commit e5172d2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
Empty file added spec/fixtures/jasmine_spec/c.js
Empty file.
43 changes: 22 additions & 21 deletions spec/jasmine_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,52 +54,53 @@ describe('Jasmine', function() {

it('add spec files with glob pattern', function() {
expect(this.testJasmine.specFiles).toEqual([]);
this.testJasmine.addSpecFiles(['spec/*.js']);
this.testJasmine.addSpecFiles(['spec/fixtures/jasmine_spec/*.js']);
expect(this.testJasmine.specFiles.map(basename)).toEqual([
'command_spec.js',
'esm_integration_spec.js',
'jasmine_spec.js',
'load_config_spec.js',
'loader_spec.js',
'c.js',
'd.js',
'e.js',
'f.js',
]);
});

it('add spec files with excluded files', function() {
expect(this.testJasmine.specFiles).toEqual([]);
this.testJasmine.addSpecFiles(['spec/*.js', '!spec/command*']);
this.testJasmine.addSpecFiles([
'spec/fixtures/jasmine_spec/*.js',
'!spec/fixtures/jasmine_spec/c*'
]);
expect(this.testJasmine.specFiles.map(basename)).toEqual([
'esm_integration_spec.js',
'jasmine_spec.js',
'load_config_spec.js',
'loader_spec.js',
'd.js',
'e.js',
'f.js',
]);
});

it('add spec files with glob pattern to existings files', function() {
var aFile = path.join(this.testJasmine.projectBaseDir, this.testJasmine.specDir, 'spec/command_spec.js');
this.testJasmine.specFiles = [aFile, 'b'];
this.testJasmine.addSpecFiles(['spec/*.js']);
this.testJasmine.addSpecFiles(['spec/fixtures/jasmine_spec/*.js']);
expect(this.testJasmine.specFiles.map(basename)).toEqual([
'command_spec.js',
'b',
'esm_integration_spec.js',
'jasmine_spec.js',
'load_config_spec.js',
'loader_spec.js',
'c.js',
'd.js',
'e.js',
'f.js',
]);
});

it('add helper files with glob pattern to existings files', function() {
var aFile = path.join(this.testJasmine.projectBaseDir, this.testJasmine.specDir, 'spec/command_spec.js');
this.testJasmine.helperFiles = [aFile, 'b'];
this.testJasmine.addHelperFiles(['spec/*.js']);
this.testJasmine.addHelperFiles(['spec/fixtures/jasmine_spec/*.js']);
expect(this.testJasmine.helperFiles.map(basename)).toEqual([
'command_spec.js',
'b',
'esm_integration_spec.js',
'jasmine_spec.js',
'load_config_spec.js',
'loader_spec.js',
'c.js',
'd.js',
'e.js',
'f.js',
]);
});
});
Expand Down

0 comments on commit e5172d2

Please sign in to comment.