diff --git a/package.json b/package.json index 205174d..31be930 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,9 @@ "test": "npm-run-all --parallel test:unit test:testcafe", "semantic-release": "semantic-release" }, - "files": [ "dist" ], + "files": [ + "dist" + ], "keywords": [], "author": "", "license": "ISC", diff --git a/src/index.js b/src/index.js index 01122d9..b72fba3 100644 --- a/src/index.js +++ b/src/index.js @@ -2,8 +2,8 @@ /* eslint-disable no-new-func */ import fs from 'fs' import path from 'path' -import {ClientFunction, Selector} from 'testcafe' -import {queries} from 'dom-testing-library' +import { ClientFunction, Selector } from 'testcafe' +import { queries } from 'dom-testing-library' const LIBRARY_UMD_PATH = path.join( './node_modules', @@ -20,11 +20,11 @@ export const addTestcafeTestingLibrary = async t => { window.TestCafeTestingLibrary = {} }, { - dependencies: {script: LIBRARY_UMD_CONTENT}, + dependencies: { script: LIBRARY_UMD_CONTENT }, }, ) - await inject.with({boundTestRun: t})() + await inject.with({ boundTestRun: t })() } Object.keys(queries).forEach(queryName => { @@ -60,3 +60,12 @@ export const within = async sel => { return container } + + +export const configure = async options => { + await ClientFunction(new Function( + ` + window.DomTestingLibrary.configure(${JSON.stringify(options)}); + ` + )) +} \ No newline at end of file diff --git a/test-app/index.html b/test-app/index.html index 42ac5e4..49024d5 100644 --- a/test-app/index.html +++ b/test-app/index.html @@ -1,74 +1,72 @@ -
- - - -- No auto-reload after changing this static HTML markup: click - ↻ Run All Tests. --
+ No auto-reload after changing this static HTML markup: click + ↻ Run All Tests. ++