Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #299 from Financial-Times/nightwatch-fix
Browse files Browse the repository at this point in the history
Fixes nightwatch bugs where the configpath was being used before it b…
  • Loading branch information
Alberto Elias committed Aug 11, 2015
2 parents da48031 + 00449cd commit c1ed2c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion lib/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ module.exports.sass = function(gulp, config) {
config.env = config.env || 'development';
var useSourceMaps = config.sourcemaps === true || config.env === 'development';

console.log("Current working directory: ", cwd);
var sassConfig = {
includePaths: [path.join(cwd, 'bower_components')].concat(config.sassIncludePaths || []),
outputStyle: config.env === 'production' ? 'compressed' : 'nested'
Expand Down
12 changes: 9 additions & 3 deletions lib/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,21 @@ module.exports.browserTest = function(gulp, config) {
var demo = require('./demo');

config = config || {};
config.nightwatchConfig = config.nightwatchConfig || path.resolve('.', 'test/browser/nightwatch.json');

var appName = files.getModuleName();
var token;
var commit;
var packageJsonContent = fs.readFileSync(path.join(process.cwd(), 'package.json'), 'utf8');

function cleanupTest(output) {
fs.unlink('Procfile');
fs.unlink(config.nightwatchConfig.replace('json', 'tmp.json'));
try {
fs.unlinkSync('Procfile');
fs.unlinkSync(config.nightwatchConfig.replace('json', 'tmp.json'));
} catch (e) {
// Suppress errors
}

fs.writeFileSync(path.join(process.cwd(), 'package.json'), packageJsonContent, 'utf8');

if (output && output.stdout) {
Expand Down Expand Up @@ -230,7 +237,6 @@ module.exports.browserTest = function(gulp, config) {
pollHeroku(config.testUrl);
})
.then(function() {
config.nightwatchConfig = config.nightwatchConfig || path.resolve('.', 'test/browser/nightwatch.json');
return module.exports._runBrowserTest(config);
})
.then(function(output) {
Expand Down

0 comments on commit c1ed2c9

Please sign in to comment.