mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
tests: Use window.foo
instead of var foo
This commit is contained in:
parent
aea2fb7448
commit
4fa9f9e9d8
2 changed files with 2 additions and 4 deletions
|
@ -26,7 +26,7 @@ exports.expressCreateServer = (hookName, args, cb) => {
|
||||||
|
|
||||||
console.debug('Sent browser the following test specs:', files);
|
console.debug('Sent browser the following test specs:', files);
|
||||||
res.setHeader('content-type', 'application/javascript');
|
res.setHeader('content-type', 'application/javascript');
|
||||||
res.end(`var frontendTestSpecs = ${JSON.stringify(files)};\n`);
|
res.end(`window.frontendTestSpecs = ${JSON.stringify(files)};\n`);
|
||||||
});
|
});
|
||||||
|
|
||||||
const rootTestFolder = path.join(settings.root, 'src/tests/frontend/');
|
const rootTestFolder = path.join(settings.root, 'src/tests/frontend/');
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/* global frontendTestSpecs */
|
|
||||||
|
|
||||||
$(() => {
|
$(() => {
|
||||||
const stringifyException = (exception) => {
|
const stringifyException = (exception) => {
|
||||||
let err = exception.stack || exception.toString();
|
let err = exception.stack || exception.toString();
|
||||||
|
@ -144,7 +142,7 @@ $(() => {
|
||||||
require.setGlobalKeyPath('require');
|
require.setGlobalKeyPath('require');
|
||||||
|
|
||||||
const $body = $('body');
|
const $body = $('body');
|
||||||
for (const spec of frontendTestSpecs.map((spec) => encodeURI(spec))) {
|
for (const spec of window.frontendTestSpecs.map((spec) => encodeURI(spec))) {
|
||||||
$body.append($('<script>').attr('src', spec.startsWith('/') ? spec : `specs/${spec}`));
|
$body.append($('<script>').attr('src', spec.startsWith('/') ? spec : `specs/${spec}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue