diff --git a/tests/js/objects/jsfmt.spec.js b/tests/js/objects/jsfmt.spec.js index 5ac39ca0386f..74867c290696 100644 --- a/tests/js/objects/jsfmt.spec.js +++ b/tests/js/objects/jsfmt.spec.js @@ -4,6 +4,6 @@ run_spec(__dirname, ["babel"], { "expression.js", "invalid-accessor-generator.js", "invalid-setter.js", - ] + ], }, }); diff --git a/tests/js/variable_declarator/__snapshots__/jsfmt.spec.js.snap b/tests/js/variable_declarator/__snapshots__/jsfmt.spec.js.snap index 8176ccad8608..a89b178417dc 100644 --- a/tests/js/variable_declarator/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/variable_declarator/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,19 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`invalid-const.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +const foo; + +=====================================output===================================== +const foo; + +================================================================================ +`; + exports[`multiple.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] diff --git a/tests/js/variable_declarator/invalid-const.js b/tests/js/variable_declarator/invalid-const.js new file mode 100644 index 000000000000..f15614ea39c3 --- /dev/null +++ b/tests/js/variable_declarator/invalid-const.js @@ -0,0 +1 @@ +const foo; diff --git a/tests/js/variable_declarator/jsfmt.spec.js b/tests/js/variable_declarator/jsfmt.spec.js index eb85eda6bd02..7ad187763274 100644 --- a/tests/js/variable_declarator/jsfmt.spec.js +++ b/tests/js/variable_declarator/jsfmt.spec.js @@ -1 +1,6 @@ -run_spec(__dirname, ["babel", "flow", "typescript"]); +run_spec(__dirname, ["babel", "flow", "typescript"], { + errors: { + espree: ["invalid-const.js"], + flow: ["invalid-const.js"], + }, +});