Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Component from '@glimmer/component';

/** It's a component */
class MyComponent extends Component {
get rows() {
return 5;
}

historyBack = () => history.back();

<template>
<h1>Class top level template.</h1>
</template>
}
18 changes: 18 additions & 0 deletions tests/unit-tests/__snapshots__/format.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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();

<template>
<h1>Class top level template.</h1>
</template>
}
"
`;

exports[`format > config > default > it formats ../cases/gjs/component-class-with-template-literal.gjs 1`] = `
"import Component from "@glimmer/component";

Expand Down
18 changes: 18 additions & 0 deletions tests/unit-tests/config/__snapshots__/semi-false.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I manually edited this snapshot to correct it (I put the semicolon in here), so that the test would fail as the bug has not been fixed as of writing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect.


<template>
<h1>Class top level template.</h1>
</template>
}
"
`;

exports[`config > semi: false > it formats ../cases/gjs/component-class-with-template-literal.gjs 1`] = `
"import Component from "@glimmer/component"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

<template>
<h1>Class top level template.</h1>
</template>
}
"
`;

exports[`config > templateExportDefault: true > it formats ../cases/gjs/component-class-with-template-literal.gjs 1`] = `
"import Component from "@glimmer/component";

Expand Down