@@ -2,6 +2,7 @@ var ConfigParser = require('../../lib/configParser');
2
2
var path = require ( 'path' ) ;
3
3
4
4
describe ( 'the config parser' , function ( ) {
5
+
5
6
it ( 'should have a default config' , function ( ) {
6
7
var config = new ConfigParser ( ) . getConfig ( ) ;
7
8
expect ( config . specs ) . toEqual ( [ ] ) ;
@@ -23,7 +24,7 @@ describe('the config parser', function() {
23
24
getConfig ( ) ;
24
25
25
26
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 ) ;
27
28
expect ( config . specs . length ) . toEqual ( 1 ) ;
28
29
expect ( config . specs [ 0 ] ) . toEqual ( 'fakespec*.js' ) ;
29
30
} ) ;
@@ -35,7 +36,7 @@ describe('the config parser', function() {
35
36
36
37
var config = new ConfigParser ( ) . addConfig ( toAdd ) . getConfig ( ) ;
37
38
38
- expect ( config . onPrepare ) . toEqual ( process . cwd ( ) + '/baz/qux.js' ) ;
39
+ expect ( config . onPrepare ) . toEqual ( path . normalize ( process . cwd ( ) + '/baz/qux.js' ) ) ;
39
40
} ) ;
40
41
41
42
describe ( 'resolving globs' , function ( ) {
@@ -47,8 +48,8 @@ describe('the config parser', function() {
47
48
var config = new ConfigParser ( ) . addConfig ( toAdd ) . getConfig ( ) ;
48
49
var specs = ConfigParser . resolveFilePatterns ( config . specs ) ;
49
50
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 ) ;
52
53
} ) ;
53
54
54
55
it ( 'should resolve relative to the config file dir' , function ( ) {
@@ -58,8 +59,8 @@ describe('the config parser', function() {
58
59
var specs = ConfigParser . resolveFilePatterns (
59
60
config . specs , false , config . configDir ) ;
60
61
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 ) ;
63
64
} ) ;
64
65
} ) ;
65
66
} ) ;
0 commit comments