mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 02:31:34 +08:00
refactor(e2e-test): wrap the test registration
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
const glob = require('glob');
|
||||
const Mocha = require('mocha');
|
||||
const path = require('path');
|
||||
|
||||
const mocha = new Mocha();
|
||||
|
||||
function startDevServer() {
|
||||
const server = require('@stencil/dev-server/dist'); // TODO: fix after stencil-dev-server PR #16 is merged
|
||||
const cmdArgs = ['--config', path.join(__dirname, '../stencil.config.js'), '--no-open'];
|
||||
@ -25,11 +25,16 @@ function getTestFiles() {
|
||||
}
|
||||
|
||||
(async () => {
|
||||
const mocha = new Mocha({
|
||||
timeout: 5000,
|
||||
slow: 2000
|
||||
});
|
||||
|
||||
const devServer = await startDevServer();
|
||||
// process.env.takeScreenshots = true;
|
||||
|
||||
const files = await getTestFiles();
|
||||
files.forEach(f => mocha.addFile(f));
|
||||
|
||||
mocha.run(function(failures) {
|
||||
process.on('exit', function() {
|
||||
process.exit(failures); // exit with non-zero status if there were failures
|
||||
|
Reference in New Issue
Block a user