diff --git a/package.json b/package.json index af876122c..1dcfcea9e 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "@typescript-eslint/parser": "^5.0.0", "babel-jest": "^29.0.0", "babel-plugin-replace-ts-export-assignment": "^0.0.2", - "dedent": "1.3.0", + "dedent": "^1.5.0", "eslint": "^7.0.0 || ^8.0.0", "eslint-config-prettier": "^8.3.0", "eslint-doc-generator": "^1.0.0", diff --git a/src/rules/__tests__/prefer-snapshot-hint.test.ts b/src/rules/__tests__/prefer-snapshot-hint.test.ts index 32f94d0ed..dad2b6cde 100644 --- a/src/rules/__tests__/prefer-snapshot-hint.test.ts +++ b/src/rules/__tests__/prefer-snapshot-hint.test.ts @@ -43,13 +43,6 @@ ruleTester.run('prefer-snapshot-hint (always)', rule, { `, options: ['always'], }, - { - code: dedent` - const x = "snapshot"; - expect(1).toMatchSnapshot(\`my $\{x}\`); - `, - options: ['always'], - }, { code: 'expect(1).toThrowErrorMatchingSnapshot("my snapshot");', options: ['always'], @@ -208,6 +201,20 @@ ruleTester.run('prefer-snapshot-hint (always)', rule, { }, ], }, + { + code: dedent` + const x = "snapshot"; + expect(1).toMatchSnapshot(\`my $\{x}\`); + `, + options: ['always'], + errors: [ + { + messageId: 'missingHint', + column: 11, + line: 2, + }, + ], + }, ], }); diff --git a/yarn.lock b/yarn.lock index b5d03c3e3..53459f031 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4418,22 +4418,22 @@ __metadata: languageName: node linkType: hard -"dedent@npm:1.3.0": - version: 1.3.0 - resolution: "dedent@npm:1.3.0" +"dedent@npm:^0.7.0": + version: 0.7.0 + resolution: "dedent@npm:0.7.0" + checksum: 87de191050d9a40dd70cad01159a0bcf05ecb59750951242070b6abf9569088684880d00ba92a955b4058804f16eeaf91d604f283929b4f614d181cd7ae633d2 + languageName: node + linkType: hard + +"dedent@npm:^1.5.0": + version: 1.5.0 + resolution: "dedent@npm:1.5.0" peerDependencies: babel-plugin-macros: ^3.1.0 peerDependenciesMeta: babel-plugin-macros: optional: true - checksum: 7554941491ab9c5181e3f404e5f5dba1c798fd720d146a7f398bd5d09a9aea7ba18bdc00ed3237d4f612bbe0e9d65754ce2f24745820e9a7be3238c128ea3ea2 - languageName: node - linkType: hard - -"dedent@npm:^0.7.0": - version: 0.7.0 - resolution: "dedent@npm:0.7.0" - checksum: 87de191050d9a40dd70cad01159a0bcf05ecb59750951242070b6abf9569088684880d00ba92a955b4058804f16eeaf91d604f283929b4f614d181cd7ae633d2 + checksum: 4af23b141e10a21138e5c481b7653e857c2c0c836741cb659f547b38d5d3bac93041e78892ab17b363a6eda815b809567b7df1e3dbc575a7d097d0f57e144ae8 languageName: node linkType: hard @@ -4994,7 +4994,7 @@ __metadata: "@typescript-eslint/utils": ^5.10.0 babel-jest: ^29.0.0 babel-plugin-replace-ts-export-assignment: ^0.0.2 - dedent: 1.3.0 + dedent: ^1.5.0 eslint: ^7.0.0 || ^8.0.0 eslint-config-prettier: ^8.3.0 eslint-doc-generator: ^1.0.0