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

Commit

Permalink
fix(test): Fixed path of configuration file to pass on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Parashuram authored and juliemr committed Mar 21, 2014
1 parent 6c6d131 commit 8964ac9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions spec/unit/config_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var ConfigParser = require('../../lib/configParser');
var path = require('path');

describe('the config parser', function() {

it('should have a default config', function() {
var config = new ConfigParser().getConfig();
expect(config.specs).toEqual([]);
Expand All @@ -23,7 +24,7 @@ describe('the config parser', function() {
getConfig();

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

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

expect(config.onPrepare).toEqual(process.cwd() + '/baz/qux.js');
expect(config.onPrepare).toEqual(path.normalize(process.cwd() + '/baz/qux.js'));
});

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

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

0 comments on commit 8964ac9

Please sign in to comment.