diff --git a/package.json b/package.json index 816ace83..5045a5d0 100644 --- a/package.json +++ b/package.json @@ -45,13 +45,13 @@ "jest-environment-jsdom-sixteen": "^1.0.3", "jest-watch-select-projects": "^2.0.0", "jsdom": "^16.2.1", - "kcd-scripts": "^5.6.0", + "kcd-scripts": "^11.1.0", "pretty-format": "^25.1.0" }, "eslintConfig": { "extends": "./node_modules/kcd-scripts/eslint.js", "rules": { - "babel/no-invalid-this": "off" + "@babel/no-invalid-this": "off" }, "overrides": [ { diff --git a/src/__tests__/to-contain-html.js b/src/__tests__/to-contain-html.js index d4ad11ea..6bfd95e4 100644 --- a/src/__tests__/to-contain-html.js +++ b/src/__tests__/to-contain-html.js @@ -102,11 +102,11 @@ describe('.toContainHTML', () => { } expect(errorMessage).toMatchInlineSnapshot(` - "expect(element).toContainHTML() - Expected: -
non-existant element
- Received: - " - `) +expect(element).toContainHTML() +Expected: +
non-existant element
+Received: + +`) }) }) diff --git a/src/__tests__/to-have-display-value.js b/src/__tests__/to-have-display-value.js index 05ac73e7..c018ab7c 100644 --- a/src/__tests__/to-have-display-value.js +++ b/src/__tests__/to-have-display-value.js @@ -129,7 +129,7 @@ test('it should throw if element is not valid', () => { } expect(errorMessage).toMatchInlineSnapshot( - `".toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead."`, + `.toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.`, ) try { @@ -139,7 +139,7 @@ test('it should throw if element is not valid', () => { } expect(errorMessage).toMatchInlineSnapshot( - `".toHaveDisplayValue() currently does not support input[type=\\"radio\\"], try with another matcher instead."`, + `.toHaveDisplayValue() currently does not support input[type="radio"], try with another matcher instead.`, ) try { @@ -149,7 +149,7 @@ test('it should throw if element is not valid', () => { } expect(errorMessage).toMatchInlineSnapshot( - `".toHaveDisplayValue() currently does not support input[type=\\"checkbox\\"], try with another matcher instead."`, + `.toHaveDisplayValue() currently does not support input[type="checkbox"], try with another matcher instead.`, ) }) diff --git a/src/__tests__/to-have-value.js b/src/__tests__/to-have-value.js index d0159361..80cc7828 100644 --- a/src/__tests__/to-have-value.js +++ b/src/__tests__/to-have-value.js @@ -115,13 +115,13 @@ describe('.toHaveValue', () => { } expect(errorMessage).toMatchInlineSnapshot(` - "expect(element).toHaveValue(something else) +expect(element).toHaveValue(something else) - Expected the element to have value: - something else - Received: - foo" - `) +Expected the element to have value: + something else +Received: + foo +`) }) test('throws with type information when the expected text input value has loose equality with received value', () => { @@ -135,13 +135,13 @@ describe('.toHaveValue', () => { } expect(errorMessage).toMatchInlineSnapshot(` - "expect(element).toHaveValue(8) +expect(element).toHaveValue(8) - Expected the element to have value: - 8 (number) - Received: - 8 (string)" - `) +Expected the element to have value: + 8 (number) +Received: + 8 (string) +`) }) test('throws when using not but the expected input value does match', () => { @@ -155,13 +155,13 @@ describe('.toHaveValue', () => { errorMessage = error.message } expect(errorMessage).toMatchInlineSnapshot(` - "expect(element).not.toHaveValue(foo) +expect(element).not.toHaveValue(foo) - Expected the element not to have value: - foo - Received: - foo" - `) +Expected the element not to have value: + foo +Received: + foo +`) }) test('throws when the form has no a value but a value is expected', () => { @@ -175,13 +175,13 @@ describe('.toHaveValue', () => { errorMessage = error.message } expect(errorMessage).toMatchInlineSnapshot(` - "expect(element).toHaveValue(expected) +expect(element).toHaveValue(expected) - Expected the element to have value: - (any) - Received: - " - `) +Expected the element to have value: + (any) +Received: + +`) }) test('throws when the form has a value but none is expected', () => { @@ -195,12 +195,12 @@ describe('.toHaveValue', () => { errorMessage = error.message } expect(errorMessage).toMatchInlineSnapshot(` - "expect(element).not.toHaveValue(expected) +expect(element).not.toHaveValue(expected) - Expected the element not to have value: - (any) - Received: - foo" - `) +Expected the element not to have value: + (any) +Received: + foo +`) }) }) diff --git a/src/to-be-in-the-document.js b/src/to-be-in-the-document.js index 765b3cf5..8ccc451a 100644 --- a/src/to-be-in-the-document.js +++ b/src/to-be-in-the-document.js @@ -29,7 +29,7 @@ export function toBeInTheDocument(element) { '', ), '', - // eslint-disable-next-line babel/new-cap + // eslint-disable-next-line @babel/new-cap this.utils.RECEIVED_COLOR(this.isNot ? errorFound() : errorNotFound()), ].join('\n') }, diff --git a/src/to-contain-element.js b/src/to-contain-element.js index 93cc8818..c94ddbf9 100644 --- a/src/to-contain-element.js +++ b/src/to-contain-element.js @@ -17,7 +17,7 @@ export function toContainElement(container, element) { 'element', ), '', - // eslint-disable-next-line babel/new-cap + // eslint-disable-next-line @babel/new-cap this.utils.RECEIVED_COLOR(`${this.utils.stringify( container.cloneNode(false), )} ${ diff --git a/src/to-contain-html.js b/src/to-contain-html.js index 714048ca..ccbff5f5 100644 --- a/src/to-contain-html.js +++ b/src/to-contain-html.js @@ -23,7 +23,7 @@ export function toContainHTML(container, htmlText) { '', ), 'Expected:', - // eslint-disable-next-line babel/new-cap + // eslint-disable-next-line @babel/new-cap ` ${this.utils.EXPECTED_COLOR(htmlText)}`, 'Received:', ` ${this.utils.printReceived(container.cloneNode(true))}`, diff --git a/src/utils.js b/src/utils.js index ba38629e..a7c61dda 100644 --- a/src/utils.js +++ b/src/utils.js @@ -28,7 +28,7 @@ class GenericTypeError extends Error { '', ), '', - // eslint-disable-next-line babel/new-cap + // eslint-disable-next-line @babel/new-cap `${context.utils.RECEIVED_COLOR( 'received', )} value must ${expectedString}.`, @@ -91,9 +91,9 @@ class InvalidCSSError extends Error { this.message = [ received.message, '', - // eslint-disable-next-line babel/new-cap + // eslint-disable-next-line @babel/new-cap context.utils.RECEIVED_COLOR(`Failing css:`), - // eslint-disable-next-line babel/new-cap + // eslint-disable-next-line @babel/new-cap context.utils.RECEIVED_COLOR(`${received.css}`), ].join('\n') } @@ -137,11 +137,11 @@ function getMessage( ) { return [ `${matcher}\n`, - // eslint-disable-next-line babel/new-cap + // eslint-disable-next-line @babel/new-cap `${expectedLabel}:\n${context.utils.EXPECTED_COLOR( redent(display(context, expectedValue), 2), )}`, - // eslint-disable-next-line babel/new-cap + // eslint-disable-next-line @babel/new-cap `${receivedLabel}:\n${context.utils.RECEIVED_COLOR( redent(display(context, receivedValue), 2), )}`,