diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..e48c9e8ca --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# This will treat all files as text files and convert to OS's line ending on checkout +# and back to LF on commit automatically. +# It also leaves all files detected as binary untouched. +* text=auto + +.gitignore text +*.md text +*.js text eol=lf +*.jsx text eol=lf diff --git a/CHANGELOG.md b/CHANGELOG.md index 08268c73e..b19cd9dd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Changelog Unreleased ---------- ### Changed +* Use path.join to allow for windows development * Removed sauce labs config and install java 8 in a different way for travis ci 2.1.0 - (October 5, 2017) diff --git a/nightwatch.conf.js b/nightwatch.conf.js index 661d9ee33..925576d95 100644 --- a/nightwatch.conf.js +++ b/nightwatch.conf.js @@ -1,6 +1,8 @@ const nightwatchConfig = require('./lib/nightwatch/nightwatch.config.js').default; const webpackConfig = require('./tests/test.config.js'); +const path = require('path'); -const config = nightwatchConfig(webpackConfig, 'tests/nightwatch/'); +const testPath = path.join('tests', 'nightwatch'); +const config = nightwatchConfig(webpackConfig, testPath); module.exports = config; diff --git a/package.json b/package.json index 63263802b..f3ee2f1d8 100644 --- a/package.json +++ b/package.json @@ -24,17 +24,17 @@ }, "scripts": { "clean:all": "npm run clean:compiled && npm run clean:dependencies", - "clean:compiled": "rimraf ./lib", - "clean:dependencies": "rimraf ./node_modules", + "clean:compiled": "rimraf lib", + "clean:dependencies": "rimraf node_modules", "clean:install": "npm run clean:all && npm install && npm run compile:build", "compile": "npm run clean:compiled && npm run compile:build", - "compile:build": "$(npm bin)/babel src --out-dir lib --copy-files", + "compile:build": "babel src --out-dir lib --copy-files", "danger": "danger", "lint": "eslint --ext .js,.jsx .", "pretest": "npm run lint", - "release:major": "npm test && node ./scripts/release/release.js major", - "release:minor": "npm test && node ./scripts/release/release.js minor", - "release:patch": "npm test && node ./scripts/release/release.js patch", + "release:major": "npm test && node scripts/release/release.js major", + "release:minor": "npm test && node scripts/release/release.js minor", + "release:patch": "npm test && node scripts/release/release.js patch", "nightwatch": "nightwatch", "nightwatch:port-provided": "nightwatch -c tests/test.nightwatch.conf.js", "test": "npm run compile && npm run nightwatch && npm run nightwatch:port-provided" diff --git a/src/nightwatch/setup-helper.js b/src/nightwatch/setup-helper.js index e651af68b..51ef641bc 100644 --- a/src/nightwatch/setup-helper.js +++ b/src/nightwatch/setup-helper.js @@ -1,4 +1,5 @@ const fs = require('fs'); +const path = require('path'); const loadJsonFile = require('load-json-file'); const globSync = require('glob').sync; @@ -6,7 +7,7 @@ const getPackageTestDirectories = lernaJSON => loadJsonFile.sync(lernaJSON).packages .map(globPath => globSync(globPath) - .map(packagePath => `${packagePath}/tests/nightwatch/`) + .map(packagePath => path.join(packagePath, 'tests', 'nightwatch')) .filter(fs.existsSync)) .reduce((a, b) => a.concat(b), []); diff --git a/tests/test.config.js b/tests/test.config.js index 565468107..4567d8055 100644 --- a/tests/test.config.js +++ b/tests/test.config.js @@ -8,12 +8,12 @@ const Autoprefixer = require('autoprefixer'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); -const baseDir = __dirname.split('/tests')[0]; +const baseDir = __dirname.split('tests')[0]; module.exports = { entry: { 'babel-polyfill': 'babel-polyfill', // eslint-disable-next-line quote-props, - 'index': path.join(__dirname, 'nightwatch/fixtures/index'), + 'index': path.join(__dirname, 'nightwatch', 'fixtures', 'index'), }, module: { loaders: [ @@ -66,7 +66,7 @@ module.exports = { chunks: ['babel-polyfill'], }), new HtmlWebpackPlugin({ - template: path.join(__dirname, 'nightwatch/fixtures/index.html'), + template: path.join(__dirname, 'nightwatch', 'fixtures', 'index.html'), chunks: ['index'], }), new webpack.NamedChunksPlugin(), @@ -75,10 +75,10 @@ module.exports = { // See https://github.com/facebook/react/issues/8026 extensions: ['.js', '.jsx'], alias: { - moment: path.resolve(baseDir, 'node_modules/moment'), - react: path.resolve(baseDir, 'node_modules/react'), - 'react-intl': path.resolve(baseDir, 'node_modules/react-intl'), - 'react-dom': path.resolve(baseDir, 'node_modules/react-dom'), + moment: path.resolve(baseDir, 'node_modules', 'moment'), + react: path.resolve(baseDir, 'node_modules', 'react'), + 'react-intl': path.resolve(baseDir, 'node_modules', 'react-intl'), + 'react-dom': path.resolve(baseDir, 'node_modules', 'react-dom'), }, }, output: { diff --git a/tests/test.nightwatch.conf.js b/tests/test.nightwatch.conf.js index 92eca0b56..426312c8d 100644 --- a/tests/test.nightwatch.conf.js +++ b/tests/test.nightwatch.conf.js @@ -1,7 +1,10 @@ const nightwatchConfig = require('../lib/nightwatch/nightwatch.config.js').default; const webpackConfig = require('./test.config.js'); +const path = require('path'); + +const testPath = path.join('tests', 'nightwatch'); // Allows one to specify port number in configuration -const config = nightwatchConfig(webpackConfig, ['tests/nightwatch/'], 9000); +const config = nightwatchConfig(webpackConfig, [testPath], 9000); module.exports = config;