Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4155009
jest.setup.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
jest.setup.js
View Options
'use strict'
;
/* eslint-disable no-undef */
const
{
config
}
=
require
(
'@vue/test-utils'
);
const
mockMediaWiki
=
require
(
'@wikimedia/mw-node-qunit/src/mockMediaWiki.js'
);
// Mock Vue plugins in test suites
global
.
mw
=
mockMediaWiki
();
global
.
mw
.
message
=
jest
.
fn
(
(
...
messageKeyAndParams
)
=>
(
{
text
:
()
=>
`(
${
messageKeyAndParams
.
join
(
', '
)
}
)`
,
parse
:
()
=>
`(
${
messageKeyAndParams
.
join
(
', '
)
}
)`
,
escaped
:
()
=>
`(
${
messageKeyAndParams
.
join
(
', '
)
}
)`
}
)
);
global
.
mw
.
msg
=
jest
.
fn
(
(
...
messageKeyAndParams
)
=>
`(
${
messageKeyAndParams
.
join
(
', '
)
}
)`
);
global
.
mw
.
storage
=
{
session
:
{
get
:
jest
.
fn
(),
set
:
jest
.
fn
()
},
set
:
jest
.
fn
()
};
global
.
mw
.
notify
=
jest
.
fn
();
config
.
global
.
mocks
=
{
$i18n
:
(
...
messageKeyAndParams
)
=>
(
{
text
:
()
=>
'('
+
messageKeyAndParams
.
join
(
', '
)
+
')'
,
parse
:
()
=>
'('
+
messageKeyAndParams
.
join
(
', '
)
+
')'
}
)
};
config
.
global
.
directives
=
{
'i18n-html'
:
(
el
,
binding
)
=>
{
el
.
innerHTML
=
`
${
binding
.
arg
}
(
${
binding
.
value
}
)`
;
}
};
// Ignore all "teleport" behavior for the purpose of testing Dialog;
// see https://test-utils.vuejs.org/guide/advanced/teleport.html
config
.
global
.
stubs
=
{
teleport
:
true
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 19 2026, 21:29 (7 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a3/65/b0d41ea80aa454eccc1b53148344
Default Alt Text
jest.setup.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment