Skip to content

Commit

Permalink
Update version to 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ccampbell committed Dec 9, 2019
1 parent 46c9c62 commit 0e87305
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
19 changes: 18 additions & 1 deletion bin/luna.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
/* Luna v1.4.0 */
/* Luna v1.5.0 */
'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
Expand Down Expand Up @@ -972,6 +972,11 @@ async function runTestBrowser(browser, testPath, options) {
}

const url = `http://localhost:${options.port}/run/${testPath}`;

if (options.debug) {
console.log(`🔗 Opening URL: ${url}`);
}

let results = {};
page.on('console', async(msg) => {
const newMsg = await formatLog(msg);
Expand Down Expand Up @@ -1284,8 +1289,17 @@ async function runTests(options) {

console.log(`⚡️ Took ${getElapsedTime(startTime, endTime)}`);

// We can always close the browser
if (!options.node) {
await browser.close();
}

if (options.debug) {
// In debug mode we want to keep the server running
return;
}

if (!options.node) {
await server.close();
}

Expand Down Expand Up @@ -1346,6 +1360,7 @@ function showUsage(message) {
console.log('-x, --no-coverage Disable code coverage');
console.log('-t, --timeout Maximum time in seconds to wait for async tests to complete (default: 5)');
console.log('-i, --inject JavaScript file(s) to inject into the page');
console.log('-d, --debug Keep the test server running for debugging purposes');
console.log('-s, --svelte Path or glob of svelte components to compile');
console.log('-p, --port Port to run webserver on (default: 5862)');
console.log('-h, --help Show usage');
Expand All @@ -1368,6 +1383,7 @@ const argv = yargs
.alias('p', 'port')
.alias('t', 'timeout')
.alias('i', 'inject')
.alias('d', 'debug')
.alias('s', 'svelte')
.help('').argv;

Expand Down Expand Up @@ -1412,6 +1428,7 @@ const options = {
inject: argv.inject,
singleRun: argv['single-run'],
fastFail: argv['fast-fail'],
debug: argv.debug,
svelte: argv.svelte,
timeout: argv.timeout || 5
};
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "luna-testing",
"version": "1.4.0",
"version": "1.5.0",
"description": "A simple, modern, opinionated unit testing framework",
"homepage": "https://craig.is/testing/code",
"bugs": "https://github.com/ccampbell/luna/issues",
Expand Down

0 comments on commit 0e87305

Please sign in to comment.