Skip to content

Commit

Permalink
chore: better test structure / name conistency (dequelabs#738)
Browse files Browse the repository at this point in the history
* chore: better test structure / name conistency

* more descriptive describe

* finish

* remove examples

* rename file
  • Loading branch information
straker authored Jun 1, 2023
1 parent fe3721d commit 3d06f08
Show file tree
Hide file tree
Showing 20 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"scripts": {
"prebuild": "rimraf dist",
"build": "tsup src/index.ts --dts --format esm,cjs",
"test": "mocha --timeout 60000 -r ts-node/register 'tests/**.spec.ts'",
"test:esm": "node esmTest.mjs",
"test": "mocha --timeout 60000 -r ts-node/register 'test/**.spec.ts'",
"test:esm": "node test/esmTest.mjs",
"coverage": "nyc npm run test",
"prepare": "npm run build"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import defaultExport from './dist/index.mjs';
import defaultExport from '../dist/index.mjs';
import assert from 'assert';

const exportIsFunction = typeof(defaultExport) === 'function';
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
},
"scripts": {
"build": "tsup src/index.ts --dts --format esm,cjs",
"test": "mocha 'test/**/*.test.ts'",
"test:esm": "node esmTest.mjs",
"test": "mocha --timeout 60000 -r ts-node/register 'test/**.spec.ts'",
"test:esm": "node test/esmTest.mjs",
"coverage": "nyc npm run test",
"prepublishOnly": "npm run build"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import defaultExport, { AxePuppeteer } from './dist/index.mjs';
import defaultExport, { AxePuppeteer } from '../dist/index.mjs';
import assert from 'assert';
import puppeteer from 'puppeteer';
import { fileURLToPath, pathToFileURL } from 'url';
Expand All @@ -20,7 +20,7 @@ if (process.env.CI) {

async function integrationTest() {
let path = fileURLToPath(new URL('.', import.meta.url));
path = join(path, './node_modules/axe-test-fixtures/fixtures/index.html');
path = join(path, '../node_modules/axe-test-fixtures/fixtures/index.html');

const browser = await puppeteer.launch(options);
const page = await browser.newPage();
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/webdriverio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"scripts": {
"prebuild": "rimraf dist",
"build": "tsup src/index.ts --dts --format esm,cjs",
"test": "mocha --timeout 60000 -r ts-node/register 'src/test.ts'",
"test:esm": "node esmTest.mjs",
"test": "mocha --timeout 60000 -r ts-node/register 'test/**.spec.ts'",
"test:esm": "node test/esmTest.mjs",
"coverage": "nyc npm run test",
"prepare": "npm run build"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { Server, createServer } from 'http';
import net from 'net';
import fs from 'fs';
import delay from 'delay';
import AxeBuilder from '.';
import { logOrRethrowError } from './utils';
import AxeBuilder from '../src';
import { logOrRethrowError } from '../src/utils';
import type { AxeResults, Result } from 'axe-core';
import child_process from 'child_process';
import { ChildProcessWithoutNullStreams } from 'child_process';
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('@axe-core/webdriverio', () => {
});
}

describe('WebdriverIO Async', () => {
describe(`WebdriverIO Async (${protocol} protocol)`, () => {
let server: Server;
let addr: string;
let client: webdriverio.Browser;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import defaultExport from './dist/index.mjs';
import defaultExport from '../dist/index.mjs';
import assert from 'assert';
import * as webdriverio from 'webdriverio';
import { fileURLToPath, pathToFileURL } from 'url';
Expand All @@ -10,7 +10,7 @@ assert(exportIsFunction, 'export is not a function');

async function integrationTest() {
let path = fileURLToPath(new URL('.', import.meta.url));
path = join(path, './node_modules/axe-test-fixtures/fixtures/index.html');
path = join(path, '../node_modules/axe-test-fixtures/fixtures/index.html');

const options = {
automationProtocol: 'devtools',
Expand Down
4 changes: 2 additions & 2 deletions packages/webdriverjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"scripts": {
"prebuild": "rimraf dist",
"build": "tsup src/index.ts --dts --format esm,cjs",
"test": "mocha --timeout 10000 -r ts-node/register './tests/**/*.spec.ts'",
"test:esm": "node esmTest.mjs",
"test": "mocha --timeout 60000 -r ts-node/register 'test/**.spec.ts'",
"test:esm": "node test/esmTest.mjs",
"coverage": "nyc npm run test",
"prepare": "npm run build"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import defaultExport from './dist/index.mjs';
import defaultExport from '../dist/index.mjs';
import assert from 'assert';

const exportIsFunction = typeof(defaultExport) === 'function';
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 3d06f08

Please sign in to comment.