Skip to content

Commit 2bc084f

Browse files
revathskumargnapse
authored andcommitted
fix: use this.equals instead of import jasmineUtils (#103)
As per the [comment](#93 (comment)) by @SimenB This will remove the direct import of jasmineUtils `import {equals} from 'expect/build/jasmineUtils'` and instead use `this.equals`. Also removes the added dependency of `expect`.
1 parent cd15de6 commit 2bc084f

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"chalk": "^2.4.1",
3737
"css": "^2.2.3",
3838
"css.escape": "^1.5.1",
39-
"expect": "^24.7.1",
4039
"jest-diff": "^24.0.0",
4140
"jest-matcher-utils": "^24.0.0",
4241
"lodash": "^4.17.11",

src/to-have-attribute.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {matcherHint, stringify, printExpected} from 'jest-matcher-utils'
2-
import {equals} from 'expect/build/jasmineUtils'
32
import {checkHtmlElement, getMessage} from './utils'
43

54
function printAttribute(name, value) {
@@ -19,7 +18,7 @@ export function toHaveAttribute(htmlElement, name, expectedValue) {
1918
const receivedValue = htmlElement.getAttribute(name)
2019
return {
2120
pass: isExpectedValuePresent
22-
? hasAttribute && equals(receivedValue, expectedValue)
21+
? hasAttribute && this.equals(receivedValue, expectedValue)
2322
: hasAttribute,
2423
message: () => {
2524
const to = this.isNot ? 'not to' : 'to'

0 commit comments

Comments
 (0)