From eccbfcfc9fb35666e6e21c5c14b0aae44df1a028 Mon Sep 17 00:00:00 2001 From: steven nguyen Date: Mon, 14 Jun 2021 10:57:58 -0500 Subject: [PATCH 1/9] fix grammar (#380) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0ccd2d74..9ce30e9e 100644 --- a/README.md +++ b/README.md @@ -509,7 +509,7 @@ expect(getByTestId('parent')).toContainHTML('') toHaveAccessibleDescription(expectedAccessibleDescription?: string | RegExp) ``` -This allows to assert that an element has the expected +This allows you to assert that an element has the expected [accessible description](https://w3c.github.io/accname/). You can pass the exact string of the expected accessible description, or you can @@ -557,7 +557,7 @@ expect(getByTestId('logo')).toHaveAccessibleDescription( toHaveAccessibleName(expectedAccessibleName?: string | RegExp) ``` -This allows to assert that an element is has the expected +This allows you to assert that an element has the expected [accessible name](https://w3c.github.io/accname/). It is useful, for instance, to assert that form elements and buttons are properly labelled. From 0e34a35e6d47df654a939b4d71d13b2f340aa605 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 14 Jun 2021 12:08:31 -0400 Subject: [PATCH 2/9] docs: add icecream17 as a contributor for doc (#381) * docs: update README.md * docs: update .all-contributorsrc Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 1 + 2 files changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index b6dc27ef..707d4b8e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -623,6 +623,15 @@ "code", "test" ] + }, + { + "login": "icecream17", + "name": "steven nguyen", + "avatar_url": "https://avatars.githubusercontent.com/u/58114641?v=4", + "profile": "http://lichess.org/@/StevenEmily", + "contributions": [ + "doc" + ] } ], "repoHost": "https://github.com", diff --git a/README.md b/README.md index 9ce30e9e..db848d27 100644 --- a/README.md +++ b/README.md @@ -1350,6 +1350,7 @@ Thanks goes to these people ([emoji key][emojis]):
Marcel Barner

πŸ’» ⚠️
Doma

πŸ’» ⚠️
Julien Wajsberg

πŸ’» ⚠️ +
steven nguyen

πŸ“– From 60832f6c46cfb8af1ccf02c4184f06232ec61a0a Mon Sep 17 00:00:00 2001 From: tu4mo Date: Fri, 2 Jul 2021 21:56:04 +0300 Subject: [PATCH 3/9] Fix typo (#385) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db848d27..64b3deba 100644 --- a/README.md +++ b/README.md @@ -1068,7 +1068,7 @@ This allows you to check whether the given element has an Use the `aria-errormessage` attribute to reference another element that contains custom error message text. Multiple ids is **NOT** allowed. Authors MUST use -`aria-invalid` in conjunction with `aria-errormessage`. Leran more from +`aria-invalid` in conjunction with `aria-errormessage`. Learn more from [`aria-errormessage` spec](https://www.w3.org/TR/wai-aria/#aria-errormessage). Whitespace is normalized. From 51ea53620df2c7bbe66c5c8f7231d4bd8d259502 Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Sun, 11 Jul 2021 15:58:04 -0400 Subject: [PATCH 4/9] chore: upgrade to Jest 27 (#384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: upgrade to Jest 27 * fix: ESLint config Co-authored-by: Ernesto GarcΓ­a --- package.json | 4 +- src/__tests__/to-contain-html.js | 12 +++--- src/__tests__/to-have-display-value.js | 6 +-- src/__tests__/to-have-value.js | 60 +++++++++++++------------- src/to-be-in-the-document.js | 2 +- src/to-contain-element.js | 2 +- src/to-contain-html.js | 2 +- src/utils.js | 10 ++--- 8 files changed, 49 insertions(+), 49 deletions(-) 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), )}`, From d24b6be0c43d0cc9ca192d1fa6fbfb790c3e8b86 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 11 Jul 2021 16:13:05 -0400 Subject: [PATCH 5/9] docs: add tu4mo as a contributor for doc (#386) * docs: update README.md * docs: update .all-contributorsrc Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Nick McCurdy --- .all-contributorsrc | 9 +++++++++ README.md | 3 +++ 2 files changed, 12 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 707d4b8e..7e5a88a7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -632,6 +632,15 @@ "contributions": [ "doc" ] + }, + { + "login": "tu4mo", + "name": "tu4mo", + "avatar_url": "https://avatars.githubusercontent.com/u/16735302?v=4", + "profile": "http://tu4mo.com", + "contributions": [ + "doc" + ] } ], "repoHost": "https://github.com", diff --git a/README.md b/README.md index 64b3deba..e5a41091 100644 --- a/README.md +++ b/README.md @@ -1352,6 +1352,9 @@ Thanks goes to these people ([emoji key][emojis]):
Julien Wajsberg

πŸ’» ⚠️
steven nguyen

πŸ“– + +
tu4mo

πŸ“– + From d0850399648982a49e2adb6666a3310db005c691 Mon Sep 17 00:00:00 2001 From: Matan Borenkraout Date: Mon, 11 Oct 2021 15:45:43 +0300 Subject: [PATCH 6/9] chore: set protocol for npm to `https` (#409) --- .npmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.npmrc b/.npmrc index d2722898..1df2a6d8 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,2 @@ -registry=http://registry.npmjs.org/ +registry=https://registry.npmjs.org/ package-lock=false From 88760389b8630edc29593a380336fb9850b5de92 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 11 Oct 2021 12:08:42 -0300 Subject: [PATCH 7/9] docs: add MatanBobi as a contributor for platform (#410) * docs: update README.md * docs: update .all-contributorsrc Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 1 + 2 files changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7e5a88a7..cf9e1fa6 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -641,6 +641,15 @@ "contributions": [ "doc" ] + }, + { + "login": "MatanBobi", + "name": "Matan Borenkraout", + "avatar_url": "https://avatars.githubusercontent.com/u/12711091?v=4", + "profile": "https://matan.io", + "contributions": [ + "platform" + ] } ], "repoHost": "https://github.com", diff --git a/README.md b/README.md index e5a41091..5d1791ad 100644 --- a/README.md +++ b/README.md @@ -1354,6 +1354,7 @@ Thanks goes to these people ([emoji key][emojis]):
tu4mo

πŸ“– +
Matan Borenkraout

πŸ“¦ From 35ab97d28fb7c6e62f0feed6d8f397260eb10868 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 2 Nov 2021 01:47:30 -0400 Subject: [PATCH 8/9] docs: add yannbf as a contributor for code (#416) * docs: update README.md * docs: update .all-contributorsrc Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 1 + 2 files changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index cf9e1fa6..e3fe1602 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -650,6 +650,15 @@ "contributions": [ "platform" ] + }, + { + "login": "yannbf", + "name": "Yann Braga", + "avatar_url": "https://avatars.githubusercontent.com/u/1671563?v=4", + "profile": "https://github.com/yannbf", + "contributions": [ + "code" + ] } ], "repoHost": "https://github.com", diff --git a/README.md b/README.md index 5d1791ad..074152f0 100644 --- a/README.md +++ b/README.md @@ -1355,6 +1355,7 @@ Thanks goes to these people ([emoji key][emojis]):
tu4mo

πŸ“–
Matan Borenkraout

πŸ“¦ +
Yann Braga

πŸ’» From 4cb606cc591345a2f44240d7e74740b26fa9fa85 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Tue, 2 Nov 2021 06:50:34 +0100 Subject: [PATCH 9/9] feat: import parse directly from css (#415) - This will avoid having to access `fs` which will break in browser environments Co-authored-by: Nick McCurdy --- src/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.js b/src/utils.js index a7c61dda..2f07fb8e 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,5 +1,5 @@ import redent from 'redent' -import {parse} from 'css' +import cssParse from 'css/lib/parse' import isEqual from 'lodash/isEqual' class GenericTypeError extends Error { @@ -100,7 +100,7 @@ class InvalidCSSError extends Error { } function parseCSS(css, ...args) { - const ast = parse(`selector { ${css} }`, {silent: true}).stylesheet + const ast = cssParse(`selector { ${css} }`, {silent: true}).stylesheet if (ast.parsingErrors && ast.parsingErrors.length > 0) { const {reason, line} = ast.parsingErrors[0]