Skip to content

Commit 1fe0802

Browse files
committed
@babel/generator no longer allows quote formatting to be customized
1 parent 59f2b95 commit 1fe0802

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/enhance-assert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const PATTERNS = [
1616
't.notRegex(contents, regex, [message])'
1717
];
1818

19-
const computeStatement = node => generate(node, {quotes: 'single'}).code;
19+
const computeStatement = node => generate(node).code;
2020
const getNode = (ast, path) => dotProp.get(ast, path.replace(/\//g, '.'));
2121

2222
const formatter = context => {

test/api.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ function generateTests(prefix, apiCreator) {
374374
test(`${prefix} enhanced assertion formatting necessary whitespace and empty strings`, t => {
375375
const expected = [
376376
[
377-
/foo === '' && '' === foo/,
378-
/foo === ''/,
377+
/foo === "" && "" === foo/,
378+
/foo === ""/,
379379
/foo/
380380
],
381381
[
@@ -385,9 +385,9 @@ function generateTests(prefix, apiCreator) {
385385
/foo/
386386
],
387387
[
388-
/\[foo].filter\(item => {\n\s+return item === 'bar';\n}\).length > 0/,
389-
/\[foo].filter\(item => {\n\s+return item === 'bar';\n}\).length/,
390-
/\[foo].filter\(item => {\n\s+return item === 'bar';\n}\)/,
388+
/\[foo].filter\(item => {\n\s+return item === "bar";\n}\).length > 0/,
389+
/\[foo].filter\(item => {\n\s+return item === "bar";\n}\).length/,
390+
/\[foo].filter\(item => {\n\s+return item === "bar";\n}\)/,
391391
/\[foo]/,
392392
/foo/
393393
]

0 commit comments

Comments
 (0)