Commit 4e5f233d authored by Jure's avatar Jure

fix(tests): fix test command in test env

parent 85001443
......@@ -52,6 +52,44 @@ lint:
# specify host here else it confuses the linked postgres image
- PGHOST=postgres npm run test
test:chrome:
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
stage: test
variables:
GIT_STRATEGY: none
# setup data for postgres image
POSTGRES_USER: test
POSTGRES_PASSWORD: pw
# connection details for tests
PGUSER: test
PGPASSWORD: pw
NODE_ENV: test
services:
- postgres
script:
- cd ${HOME}
# specify host here else it confuses the linked postgres image
- PGHOST=postgres npx testcafe 'chrome:headless --no-sandbox' test/**/*.test.js
test:firefox:
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
stage: test
variables:
GIT_STRATEGY: none
# setup data for postgres image
POSTGRES_USER: test
POSTGRES_PASSWORD: pw
# connection details for tests
PGUSER: test
PGPASSWORD: pw
NODE_ENV: test
services:
- postgres
script:
- cd ${HOME}
# specify host here else it confuses the linked postgres image
- PGHOST=postgres npx testcafe firefox:headless test/**/*.test.js
push:latest:
image: docker:latest
stage: staging
......
......@@ -97,7 +97,8 @@
"webpack-hot-middleware": "^2.20.0"
},
"scripts": {
"test": "NODE_ENV=test testcafe chrome 'test/**/*.test.js'",
"test:chrome": "NODE_ENV=test testcafe chrome 'test/**/*.test.js'",
"test:firefox": "NODE_ENV=test testcafe firefox 'test/**/*.test.js'",
"clean": "rm -rf node_modules",
"lint": "npm run lint:js && npm run lint:style",
"lint:js": "eslint .",
......
......@@ -2,6 +2,7 @@ const config = require('config')
const path = require('path')
const webpack = require('webpack')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const rules = require('./rules.production')
const resolve = require('./common-resolve')
......@@ -36,6 +37,7 @@ module.exports = [
new CopyWebpackPlugin([{ from: '../static' }]),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new ExtractTextPlugin('styles.css'),
],
node: {
fs: 'empty',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment