Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 8964ac9

Browse files
Parashuramjuliemr
Parashuram
authored andcommitted
fix(test): Fixed path of configuration file to pass on windows
1 parent 6c6d131 commit 8964ac9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

spec/unit/config_test.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ var ConfigParser = require('../../lib/configParser');
22
var path = require('path');
33

44
describe('the config parser', function() {
5+
56
it('should have a default config', function() {
67
var config = new ConfigParser().getConfig();
78
expect(config.specs).toEqual([]);
@@ -23,7 +24,7 @@ describe('the config parser', function() {
2324
getConfig();
2425

2526
expect(config.rootElement).toEqual('.mycontainer');
26-
expect(config.onPrepare).toMatch('/spec/unit/data/foo/bar.js');
27+
expect(config.onPrepare.indexOf(path.normalize('/spec/unit/data/foo/bar.js'))).not.toEqual(-1);
2728
expect(config.specs.length).toEqual(1);
2829
expect(config.specs[0]).toEqual('fakespec*.js');
2930
});
@@ -35,7 +36,7 @@ describe('the config parser', function() {
3536

3637
var config = new ConfigParser().addConfig(toAdd).getConfig();
3738

38-
expect(config.onPrepare).toEqual(process.cwd() + '/baz/qux.js');
39+
expect(config.onPrepare).toEqual(path.normalize(process.cwd() + '/baz/qux.js'));
3940
});
4041

4142
describe('resolving globs', function() {
@@ -47,8 +48,8 @@ describe('the config parser', function() {
4748
var config = new ConfigParser().addConfig(toAdd).getConfig();
4849
var specs = ConfigParser.resolveFilePatterns(config.specs);
4950
expect(specs.length).toEqual(2);
50-
expect(specs[0]).toMatch('unit/data/fakespecA.js');
51-
expect(specs[1]).toMatch('unit/data/fakespecB.js');
51+
expect(specs[0].indexOf(path.normalize('unit/data/fakespecA.js'))).not.toEqual(-1);
52+
expect(specs[1].indexOf(path.normalize('unit/data/fakespecB.js'))).not.toEqual(-1);
5253
});
5354

5455
it('should resolve relative to the config file dir', function() {
@@ -58,8 +59,8 @@ describe('the config parser', function() {
5859
var specs = ConfigParser.resolveFilePatterns(
5960
config.specs, false, config.configDir);
6061
expect(specs.length).toEqual(2);
61-
expect(specs[0]).toMatch('unit/data/fakespecA.js');
62-
expect(specs[1]).toMatch('unit/data/fakespecB.js');
62+
expect(specs[0].indexOf(path.normalize('unit/data/fakespecA.js'))).not.toEqual(-1);
63+
expect(specs[1].indexOf(path.normalize('unit/data/fakespecB.js'))).not.toEqual(-1);
6364
});
6465
});
6566
});

0 commit comments

Comments
 (0)