Skip to content

Commit

Permalink
Rename things
Browse files Browse the repository at this point in the history
  • Loading branch information
bearfriend committed Jul 20, 2023
1 parent 7a87801 commit 4fa0c84
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bin/test.js → bin/d2l-test-runner.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { argv } from 'node:process';
import { runner } from '../src/server/cli/test.js';
import { runner } from '../src/server/cli/test-runner.js';

const options = await runner.getOptions(argv);

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.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"test:bin": "mocha './test/bin/**/*.test.js'",
"test:browser": "web-test-runner --files './test/browser/**/*.test.js' --node-resolve --playwright",
"test:server": "mocha './test/server/**/*.test.js'",
"test:vdiff": "d2l-test --config ./test/browser/d2l-test.config.js --group vdiff",
"test:vdiff": "npx d2l-test-runner--config ./test/browser/d2l-test.config.js --group vdiff",
"test:vdiff:golden": "npm run test:vdiff -- --golden"
},
"bin": {
"d2l-test": "./bin/test.js"
"d2l-test-runner": "./bin/d2l-test-runner.js"
},
"author": "D2L Corporation",
"license": "Apache-2.0",
Expand Down
10 changes: 5 additions & 5 deletions src/server/cli/test.js → src/server/cli/test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function getTestRunnerOptions(argv = []) {
const DISALLOWED_OPTIONS = ['--browsers', '--playwright', '--puppeteer', '--groups'];

const optionDefinitions = [
// @web/test-runner options
// web-test-runner options
{
name: 'files',
type: String,
Expand Down Expand Up @@ -39,7 +39,7 @@ async function getTestRunnerOptions(argv = []) {
order: 9
},

// d2l-test options
// d2l-test-runner options
{
name: 'chrome',
type: Boolean,
Expand All @@ -50,7 +50,7 @@ async function getTestRunnerOptions(argv = []) {
name: 'config',
alias: 'c',
type: String,
description: 'Location to read config file from\n[Default: ./d2l-test.config.js]',
description: 'Location to read config file from\n[Default: ./d2l-test-runner.config.js]',
order: 9
},
{
Expand Down Expand Up @@ -111,7 +111,7 @@ async function getTestRunnerOptions(argv = []) {
},
{
header: 'Usage',
content: 'd2l-test [options]',
content: 'd2l-test-runner [options]',
},
{
header: 'Options',
Expand All @@ -127,7 +127,7 @@ async function getTestRunnerOptions(argv = []) {

cliArgs._unknown = cliArgs._unknown?.filter(o => !DISALLOWED_OPTIONS.includes(o));

const testConfig = await readConfig('d2l-test.config', cliArgs.config).catch(err => {
const testConfig = await readConfig('d2l-test-runner.config', cliArgs.config).catch(err => {
if (err instanceof ConfigLoaderError) {
throw new Error(err.message);
} else {
Expand Down
6 changes: 3 additions & 3 deletions test/bin/test.test.js → test/bin/d2l-test-runner.test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { assert, restore, stub } from 'sinon';
import { argv } from 'node:process';
import { runner } from '../../src/server/cli/test.js';
import { runner } from '../../src/server/cli/test-runner.js';

describe('d2l-test', () => {
describe('d2l-test-runner', () => {

it('starts test runner with options', async() => {
const opts = { my: 'options' };
const optionsStub = stub(runner, 'getOptions').returns(opts);
const startStub = stub(runner, 'start');
await import('../../bin/test.js');
await import('../../bin/d2l-test-runner.test.js');

assert.calledOnceWithExactly(optionsStub, argv);
assert.calledOnceWithExactly(startStub, opts);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import { runner } from '../../../src/server/cli/test.js';
import { runner } from '../../../src/server/cli/test-runner.js';

describe('runner.getOptions()', () => {

Expand Down Expand Up @@ -38,7 +38,7 @@ describe('runner.getOptions()', () => {

it('should convert aliases', async() => {
const opts = await runner.getOptions([
'-c', './test/browser/d2l-test.config.js',
'-c', './test/browser/vdiff.config.js',
'-f', 'abc',
'-g', 'ghi',
'-t', 123]
Expand Down

0 comments on commit 4fa0c84

Please sign in to comment.