Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
809afbcc
Commit
809afbcc
authored
Feb 01, 2022
by
Vamsi Vempati
Committed by
Savas Vedova
Feb 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix undefined this in toMatchInterpolatedText, clearer error message
parent
2c753f80
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
spec/frontend/__helpers__/matchers/to_match_interpolated_text.js
...ontend/__helpers__/matchers/to_match_interpolated_text.js
+7
-8
No files found.
spec/frontend/__helpers__/matchers/to_match_interpolated_text.js
View file @
809afbcc
export
const
toMatchInterpolatedText
=
(
received
,
match
)
=>
{
// Custom matchers are object methods and should be traditional functions to be able to access `utils` on `this`
export
function
toMatchInterpolatedText
(
received
,
match
)
{
let
clearReceived
;
let
clearReceived
;
let
clearMatch
;
let
clearMatch
;
...
@@ -15,16 +16,14 @@ export const toMatchInterpolatedText = (received, match) => {
...
@@ -15,16 +16,14 @@ export const toMatchInterpolatedText = (received, match) => {
const
pass
=
clearReceived
===
clearMatch
;
const
pass
=
clearReceived
===
clearMatch
;
const
message
=
pass
const
message
=
pass
?
()
=>
`
?
()
=>
`
\n\n
Expected to not be:
${
this
.
utils
.
printExpected
(
clearMatch
)}
Expected:
${
this
.
utils
.
printExpected
(
clearReceived
)}
Received:
${
this
.
utils
.
printReceived
(
clearReceived
)}
To not equal:
${
this
.
utils
.
printReceived
(
clearMatch
)}
`
`
:
()
=>
:
()
=>
`
`
\n\n
Expected to be:
${
this
.
utils
.
printExpected
(
clearMatch
)}
Expected:
${
this
.
utils
.
printExpected
(
clearReceived
)}
Received:
${
this
.
utils
.
printReceived
(
clearReceived
)}
To equal:
${
this
.
utils
.
printReceived
(
clearMatch
)}
`
;
`
;
return
{
actual
:
received
,
message
,
pass
};
return
{
actual
:
received
,
message
,
pass
};
}
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment