Skip to content

Commit 8bd23f9

Browse files
committed
fix(init.spec) Update default subdir mode for integration test of the init task.
1 parent 005aa6c commit 8bd23f9

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/tasks/init.spec.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@ describe('The Angularity init task should correctly initialise all the files nee
1212
});
1313

1414
it('should correctly initialise a project with a custom name.', function (done) {
15-
var initTempPath = helper.resolveTestTempPath('init-temp');
16-
process.chdir(initTempPath);
15+
var temporaryPath = helper.resolveTestTempPath('init-temp');
16+
process.chdir(temporaryPath);
1717

1818
var customName = 'todo';
1919

2020
helper.runAngularity(['init', '-n', customName])
2121
.then(function (result) {
2222

23+
//By default a subdirectory with the custom name is used
24+
var initProjectFolder = path.join(temporaryPath, customName);
25+
2326
//'init:bower'
24-
var bowerFile = path.join(initTempPath, 'bower.json');
27+
var bowerFile = path.join(initProjectFolder, 'bower.json');
2528
expect(fs.existsSync(bowerFile)).toBe(true);
2629

2730
var bowerFileContent = require(bowerFile);
@@ -30,19 +33,19 @@ describe('The Angularity init task should correctly initialise all the files nee
3033
expect(bowerFileContent.private).toEqual(true);
3134

3235
//'init:npm'
33-
expect(fs.existsSync(path.join(initTempPath, 'package.json'))).toBe(true);
36+
expect(fs.existsSync(path.join(initProjectFolder, 'package.json'))).toBe(true);
3437

3538
//'init:karma'
36-
expect(fs.existsSync(path.join(initTempPath, 'karma.conf.js'))).toBe(true);
39+
expect(fs.existsSync(path.join(initProjectFolder, 'karma.conf.js'))).toBe(true);
3740

3841
//'init:angularity'
39-
expect(fs.existsSync(path.join(initTempPath, 'angularity.json'))).toBe(true);
42+
expect(fs.existsSync(path.join(initProjectFolder, 'angularity.json'))).toBe(true);
4043

4144
//'init:jshint'
42-
expect(fs.existsSync(path.join(initTempPath, '.jshintrc'))).toBe(true);
45+
expect(fs.existsSync(path.join(initProjectFolder, '.jshintrc'))).toBe(true);
4346

4447
//'init:composition'
45-
var appPath = path.join(initTempPath, 'app');
48+
var appPath = path.join(initProjectFolder, 'app');
4649
expect(fs.existsSync(path.join(appPath, 'index.html'))).toBe(true);
4750
expect(fs.existsSync(path.join(appPath, 'index.js'))).toBe(true);
4851
expect(fs.existsSync(path.join(appPath, 'index.scss'))).toBe(true);

0 commit comments

Comments
 (0)