Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1426741
run.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
run.js
View Options
#!/usr/bin/env node
const
fs
=
require
(
'fs'
),
mwNodeQunit
=
require
(
'@wikimedia/mw-node-qunit'
),
sinon
=
mwNodeQunit
.
sinon
,
QUnitModule
=
QUnit
.
module
,
svgInlineLoader
=
require
(
'svg-inline-loader'
);
require
(
'@babel/register'
)(
{
presets
:
[
[
'@babel/preset-env'
,
{
targets
:
{
node
:
6
}
}
]
]
}
);
require
.
extensions
[
'.svg'
]
=
(
module
,
filename
)
=>
{
// eslint-disable-next-line security/detect-non-literal-fs-filename
const
svg
=
fs
.
readFileSync
(
filename
,
{
encoding
:
'utf8'
}
);
// eslint-disable-next-line no-underscore-dangle
module
.
_compile
(
svgInlineLoader
(
svg
),
filename
);
};
sinon
.
config
=
{
injectIntoThis
:
true
,
injectInto
:
null
,
useFakeTimers
:
false
,
useFakeServer
:
false
,
properties
:
[
'spy'
,
'stub'
,
'mock'
,
'sandbox'
]
};
mwNodeQunit
.
setUp
();
// Override Qunit.module to set up a sinon sandbox automatically
QUnit
.
module
=
function
(
name
,
localEnv
)
{
localEnv
=
localEnv
||
{};
QUnitModule
(
name
,
{
beforeEach
:
function
()
{
const
config
=
Object
.
assign
(
{},
sinon
.
config
,
{
injectInto
:
this
}
);
this
.
sandbox
=
sinon
.
createSandbox
(
config
);
if
(
localEnv
.
beforeEach
)
{
localEnv
.
beforeEach
.
call
(
this
);
}
},
afterEach
:
function
()
{
// Interop with old teardown config on mediawiki codebases
this
.
sandbox
.
restore
();
if
(
localEnv
.
afterEach
)
{
localEnv
.
afterEach
.
call
(
this
);
}
}
}
);
};
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, May 16, 13:38 (1 d, 22 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
06/dc/dd0887fdab18d5dd1ea9728b8b3c
Default Alt Text
run.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment