From 452d096f20fb82aad54b44e5b12feb86f8b6a9d1 Mon Sep 17 00:00:00 2001 From: Brad Overton Date: Tue, 2 Jan 2024 20:40:40 +1000 Subject: [PATCH] test: required semicolon test case snapshot --- ...lass-with-required-semi-before-template.gjs | 14 ++++++++++++++ .../__snapshots__/format.test.ts.snap | 18 ++++++++++++++++++ .../__snapshots__/semi-false.test.ts.snap | 18 ++++++++++++++++++ .../template-export-default.test.ts.snap | 18 ++++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 tests/cases/gjs/component-class-with-required-semi-before-template.gjs diff --git a/tests/cases/gjs/component-class-with-required-semi-before-template.gjs b/tests/cases/gjs/component-class-with-required-semi-before-template.gjs new file mode 100644 index 00000000..f04a4eec --- /dev/null +++ b/tests/cases/gjs/component-class-with-required-semi-before-template.gjs @@ -0,0 +1,14 @@ +import Component from '@glimmer/component'; + +/** It's a component */ +class MyComponent extends Component { + get rows() { + return 5; + } + + historyBack = () => history.back(); + + +} \ No newline at end of file diff --git a/tests/unit-tests/__snapshots__/format.test.ts.snap b/tests/unit-tests/__snapshots__/format.test.ts.snap index 6e57f9c6..95d33c81 100644 --- a/tests/unit-tests/__snapshots__/format.test.ts.snap +++ b/tests/unit-tests/__snapshots__/format.test.ts.snap @@ -81,6 +81,24 @@ class MyComponent extends Component { " `; +exports[`format > config > default > it formats ../cases/gjs/component-class-with-required-semi-before-template.gjs 1`] = ` +"import Component from "@glimmer/component"; + +/** It's a component */ +class MyComponent extends Component { + get rows() { + return 5; + } + + historyBack = () => history.back(); + + +} +" +`; + exports[`format > config > default > it formats ../cases/gjs/component-class-with-template-literal.gjs 1`] = ` "import Component from "@glimmer/component"; diff --git a/tests/unit-tests/config/__snapshots__/semi-false.test.ts.snap b/tests/unit-tests/config/__snapshots__/semi-false.test.ts.snap index 810a38b4..44fb835f 100644 --- a/tests/unit-tests/config/__snapshots__/semi-false.test.ts.snap +++ b/tests/unit-tests/config/__snapshots__/semi-false.test.ts.snap @@ -81,6 +81,24 @@ class MyComponent extends Component { " `; +exports[`config > semi: false > it formats ../cases/gjs/component-class-with-required-semi-before-template.gjs 1`] = ` +"import Component from "@glimmer/component" + +/** It's a component */ +class MyComponent extends Component { + get rows() { + return 5 + } + + historyBack = () => history.back(); + + +} +" +`; + exports[`config > semi: false > it formats ../cases/gjs/component-class-with-template-literal.gjs 1`] = ` "import Component from "@glimmer/component" diff --git a/tests/unit-tests/config/__snapshots__/template-export-default.test.ts.snap b/tests/unit-tests/config/__snapshots__/template-export-default.test.ts.snap index 9fda1d82..d1c61e66 100644 --- a/tests/unit-tests/config/__snapshots__/template-export-default.test.ts.snap +++ b/tests/unit-tests/config/__snapshots__/template-export-default.test.ts.snap @@ -81,6 +81,24 @@ class MyComponent extends Component { " `; +exports[`config > templateExportDefault: true > it formats ../cases/gjs/component-class-with-required-semi-before-template.gjs 1`] = ` +"import Component from "@glimmer/component"; + +/** It's a component */ +class MyComponent extends Component { + get rows() { + return 5; + } + + historyBack = () => history.back(); + + +} +" +`; + exports[`config > templateExportDefault: true > it formats ../cases/gjs/component-class-with-template-literal.gjs 1`] = ` "import Component from "@glimmer/component";