Commit 82ffbf9d authored by Fred Chasen's avatar Fred Chasen

Add Specs

parent 7233c8be
module.exports = {
globalSetup: './jest/setup.js',
globalTeardown: './jest/teardown.js',
testEnvironment: './jest/puppeteer_environment.js',
setupTestFrameworkScriptFile: './jest/setup_tests.js'
}
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
"scripts": { "scripts": {
"build": "./node_modules/.bin/rollup -c", "build": "./node_modules/.bin/rollup -c",
"start": "./node_modules/.bin/rollup -w -c rollup.server.config.js", "start": "./node_modules/.bin/rollup -w -c rollup.server.config.js",
"test": "jest", "test": "jest --config=test/jest.config.js",
"specs": "jest --config=specs/jest.config.js",
"compile": "./node_modules/.bin/babel src/ -d lib/", "compile": "./node_modules/.bin/babel src/ -d lib/",
"pretest": "npm run build", "pretest": "npm run build",
"prepare": "npm run build && npm run compile", "prepare": "npm run build && npm run compile",
......
module.exports = {
testMatch: ['**/?(*.)(spec|test).js?(x)'],
globalSetup: './jest_helpers/setup.js',
globalTeardown: './jest_helpers/teardown.js',
testEnvironment: './jest_helpers/puppeteer_environment.js',
setupTestFrameworkScriptFile: './jest_helpers/setup_tests.js'
}
...@@ -58,7 +58,7 @@ class PuppeteerEnvironment extends NodeEnvironment { ...@@ -58,7 +58,7 @@ class PuppeteerEnvironment extends NodeEnvironment {
renderedResolve(msg, width, height, orientation); renderedResolve(msg, width, height, orientation);
}); });
await page.goto(ORIGIN + '/tests/specs/' + path, { waitUntil: 'networkidle2' }); await page.goto(ORIGIN + '/specs/' + path, { waitUntil: 'networkidle2' });
return page; return page;
} }
......
...@@ -13,7 +13,7 @@ const { WS_ENDPOINT_PATH, DIR, DEBUG, CI, PORT } = require('./constants'); ...@@ -13,7 +13,7 @@ const { WS_ENDPOINT_PATH, DIR, DEBUG, CI, PORT } = require('./constants');
module.exports = async function() { module.exports = async function() {
DEBUG && console.log(chalk.green('Starting Static Server\n')); DEBUG && console.log(chalk.green('Starting Static Server\n'));
app.use(express.static(path.join(__dirname, '../'))); app.use(express.static(path.join(__dirname, '../../')));
const server = app.listen(PORT); const server = app.listen(PORT);
global.server = server; global.server = server;
global.origin = `http://localhost:${PORT}`; global.origin = `http://localhost:${PORT}`;
......
module.exports = {
testMatch: ['tests/**/?(*.)(spec|test).js?(x)'],
}
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