Skip to content

Commit

Permalink
Clean up root of repo (#9115)
Browse files Browse the repository at this point in the history
* Move jest-config into config

* Remove code-climate stuff

* Delete logs

* Move hooks into script

* Move GH files into .github

* Make sure Nightwatch dir exists

* Fix some paths

* Read from .nvmrc in our prebuild
  • Loading branch information
ncksllvn committed Nov 14, 2018
1 parent fe561ff commit 7d8d993
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 25 deletions.
15 changes: 0 additions & 15 deletions .codeclimate.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion Jenkinsfile
Expand Up @@ -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"
}
}
)
Expand Down
Expand Up @@ -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:
'<rootDir>/src/platform/testing/integration/jest-setup.js',
'<rootDir>/../src/platform/testing/integration/jest-setup.js',

// A list of paths to snapshot serializer modules Jest should use for snapshot testing
// snapshotSerializers: [],
Expand All @@ -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,
Expand Down
7 changes: 6 additions & 1 deletion 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',
Expand Down Expand Up @@ -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,
},
Expand Down
6 changes: 5 additions & 1 deletion 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',
Expand Down Expand Up @@ -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,
},
Expand Down
Empty file removed logs/.keep
Empty file.
Empty file removed logs/selenium/.keep
Empty file.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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"
Expand Down
File renamed without changes.
9 changes: 5 additions & 4 deletions script/prebuild.js
Expand Up @@ -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)) {
Expand All @@ -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);
}

0 comments on commit 7d8d993

Please sign in to comment.