diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index b62eeb0231ae..000000000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,15 +0,0 @@ -engines: - duplication: - enabled: true - config: - languages: - javascript: - mass_threshold: 100 -ratings: - paths: - - src/js/** -exclude_paths: -- test/**/* -- config/**/* -- vendor/**/* -- script/**/* diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md diff --git a/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from PULL_REQUEST_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE.md diff --git a/Jenkinsfile b/Jenkinsfile index 0e33977391e8..d484dfd3b058 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -132,7 +132,6 @@ node('vetsgov-general-purpose') { unit: { dockerImage.inside(args) { sh "cd /application && npm --no-color run test:coverage" - sh "cd /application && CODECLIMATE_REPO_TOKEN=fe4a84c212da79d7bb849d877649138a9ff0dbbef98e7a84881c97e1659a2e24 codeclimate-test-reporter < ./coverage/lcov.info" } } ) diff --git a/jest-integration.config.js b/config/jest-integration.config.js similarity index 97% rename from jest-integration.config.js rename to config/jest-integration.config.js index d0efca1340a1..349dd5664a6c 100644 --- a/jest-integration.config.js +++ b/config/jest-integration.config.js @@ -119,7 +119,7 @@ module.exports = { // The path to a module that runs some code to configure or set up the testing framework before each test setupTestFrameworkScriptFile: - '/src/platform/testing/integration/jest-setup.js', + '/../src/platform/testing/integration/jest-setup.js', // A list of paths to snapshot serializer modules Jest should use for snapshot testing // snapshotSerializers: [], @@ -143,7 +143,7 @@ module.exports = { testPathIgnorePatterns: ['/node_modules/', '.yalc'], // The regexp pattern Jest uses to detect test files - testRegex: 'src/*\\/.*\\.integration\\.spec\\.jsx?$', + testRegex: '../src/*\\/.*\\.integration\\.spec\\.jsx?$', // This option allows the use of a custom results processor // testResultsProcessor: null, diff --git a/config/nightwatch.docker-compose.js b/config/nightwatch.docker-compose.js index 4f8a55005ba6..f5c85028b428 100644 --- a/config/nightwatch.docker-compose.js +++ b/config/nightwatch.docker-compose.js @@ -1,10 +1,15 @@ /* eslint-disable camelcase, strict */ 'use strict'; +const fs = require('fs-extra'); + require('babel-core/register'); +const selenium_logs = './logs/selenium'; const selenium_server_port = process.env.SELENIUM_PORT || 4444; +fs.ensureDirSync(selenium_logs); + module.exports = { src_folders: ['./src'], output_folder: './logs/nightwatch', @@ -44,7 +49,7 @@ module.exports = { }, selenium: { start_process: false, - log_path: './logs/selenium', + log_path: selenium_logs, host: 'selenium-chrome', port: selenium_server_port, }, diff --git a/config/nightwatch.js b/config/nightwatch.js index 882bc0c4e760..2f63079fc8de 100644 --- a/config/nightwatch.js +++ b/config/nightwatch.js @@ -1,14 +1,18 @@ /* eslint-disable camelcase, strict */ 'use strict'; +const fs = require('fs-extra'); const chromedriver = require('chromedriver'); const seleniumServer = require('selenium-server'); require('babel-register'); require('babel-polyfill'); +const selenium_logs = './logs/selenium'; const selenium_server_port = process.env.SELENIUM_PORT || 4444; +fs.ensureDirSync(selenium_logs); + module.exports = { src_folders: ['./src'], output_folder: './logs/nightwatch', @@ -47,7 +51,7 @@ module.exports = { }, start_process: true, server_path: seleniumServer.path, - log_path: './logs/selenium', + log_path: selenium_logs, host: '127.0.0.1', port: selenium_server_port, }, diff --git a/logs/.keep b/logs/.keep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/logs/selenium/.keep b/logs/selenium/.keep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/package.json b/package.json index 175ae16b1748..6c93bff0b2f9 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "test:visual:baseline": "./script/run-nightwatch.sh --visual --command=baseline", "test:visual:mobile": "./script/run-nightwatch.sh --visual --mobile", "test:visual:mobile:baseline": "./script/run-nightwatch.sh --visual --command=baseline --mobile", - "test:integration": "jest -c=jest-integration.config.js", + "test:integration": "jest -c=config/jest-integration.config.js", "update:schema": "./script/update-json-schema.sh", "watch": "node script/build.js --watch", "watch:static": "npm run watch -- --entry static-pages" diff --git a/hooks/pre-commit b/script/hooks/pre-commit similarity index 100% rename from hooks/pre-commit rename to script/hooks/pre-commit diff --git a/script/prebuild.js b/script/prebuild.js index e201e2045b27..95282e70c2a9 100644 --- a/script/prebuild.js +++ b/script/prebuild.js @@ -2,12 +2,13 @@ const semver = require('semver'); const fs = require('fs'); const path = require('path'); -const minimumNodeVersion = '8.10.0'; +const nodeVersion = path.join(__dirname, '../.nvmrc'); +const minimumNodeVersion = fs.readFileSync(nodeVersion).toString(); -if (!(process.env.INSTALL_HOOKS === 'no')) { +if (process.env.INSTALL_HOOKS !== 'no') { // Make sure git pre-commit hooks are installed ['pre-commit'].forEach(hook => { - const src = path.join(__dirname, `../hooks/${hook}`); + const src = path.join(__dirname, `hooks/${hook}`); const dest = path.join(__dirname, `../.git/hooks/${hook}`); if (fs.existsSync(src)) { if (!fs.existsSync(dest)) { @@ -19,7 +20,7 @@ if (!(process.env.INSTALL_HOOKS === 'no')) { } if (semver.compare(process.version, minimumNodeVersion) === -1) { - process.stdout.write(`Node.js version (mininum): v${minimumNodeVersion}\n`); + process.stdout.write(`Node.js version (minimum): v${minimumNodeVersion}\n`); process.stdout.write(`Node.js version (installed): ${process.version}\n`); process.exit(1); }