Skip to content

Commit

Permalink
fix(tests): tests ensuring locationType: auto will fail now pass inst…
Browse files Browse the repository at this point in the history
…ead of hang
  • Loading branch information
runspired committed Jul 21, 2016
1 parent 58c721c commit a40fedf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
15 changes: 11 additions & 4 deletions node-tests/unit/commands/build-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

const td = require('testdouble');

const ui = require('../../../lib/utils/ui');
const expect = require('../../helpers/expect');
const Promise = require('ember-cli/lib/ext/promise');

Expand All @@ -19,8 +21,8 @@ describe('Build Command', () => {
BuildCmd.project.config = function() {
return {
locationType: 'hash'
}
}
};
};
});

afterEach(() => {
Expand Down Expand Up @@ -93,8 +95,13 @@ describe('Build Command', () => {
BuildCmd.project.config = function() {
return {
locationType: 'auto'
}
}
};
};

td.replace(ui, 'writeLine', () => {
throw new Error('Exit Called');
});

});

it('throws', () => {
Expand Down
1 change: 0 additions & 1 deletion node-tests/unit/commands/open-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ describe('Open Command', () => {
});

it('runs Open App Task', () => {

return OpenCmd.run.call({ project: mockProject }, { application: 'dummy', platform: 'ios' })
.then(function() {
return true;
Expand Down
7 changes: 6 additions & 1 deletion node-tests/unit/commands/serve-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const td = require('testdouble');
const expect = require('../../helpers/expect');
const Promise = require('ember-cli/lib/ext/promise');

const ui = require('../../../lib/utils/ui');
const ServeCmd = require('../../../lib/commands/serve');
const BuildWatchTask = require('../../../lib/tasks/ember-build-watch');
const CdvBuildTask = require('../../../lib/tasks/cordova-build');
Expand Down Expand Up @@ -94,8 +95,12 @@ describe('Serve Command', () => {
ServeCmd.project.config = function() {
return {
locationType: 'auto'
}
};
};

td.replace(ui, 'writeLine', () => {
throw new Error('Exit Called');
});
});

it('throws', () => {
Expand Down

0 comments on commit a40fedf

Please sign in to comment.