feat(client): make all sources available in tests (#44725)

* feat: make all sources available in tests

The original contents of all files (index.html, script.js etc.) will be
accessible in tests.  For example __sources['index.html'] gets the
original html file and nothing else.

* feat: use __file to get user code
This commit is contained in:
Oliver Eyton-Williams
2022-02-15 18:59:31 +01:00
committed by GitHub
parent 137edc2fb3
commit cde1407f58
5 changed files with 23 additions and 9 deletions

View File

@ -675,7 +675,11 @@ async function initializeTestRunner(build, sources, code, loadEnzyme) {
await page.evaluate(
async (code, sources, loadEnzyme) => {
const getUserInput = fileName => sources[fileName];
await document.__initTestFrame({ code, getUserInput, loadEnzyme });
await document.__initTestFrame({
code: sources,
getUserInput,
loadEnzyme
});
},
code,
sources,