Skip to content

Commit

Permalink
chore: fix gitignore issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsjtu committed Jul 9, 2024
1 parent 927570f commit 43277be
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/generators/lightningComponentGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default class LightningComponentGenerator extends BaseGenerator<Lightning

if (template === 'typeScript') {
await this.render(
this.templatePath('.gitignore'),
this.templatePath('gitignore'),
this.destinationPath(
path.join(this.outputdir, camelCaseComponentName, '.gitignore')
),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { createElement } from 'lwc';
import <%= pascalCaseComponentName %> from 'c/<%= camelCaseComponentName %>';

describe('c-<%= kebabCaseComponentName %>', () => {
afterEach(() => {
// The jsdom instance is shared across test cases in a single file so reset the DOM
while (document.body.firstChild) {
document.body.removeChild(document.body.firstChild);
}
});

it('TODO: test case generated by CLI command, please fill in test logic', () => {
// Arrange
const element = createElement('c-<%= kebabCaseComponentName %>', {
is: <%= pascalCaseComponentName %>
});

// Act
document.body.appendChild(element);

// Assert
// const div = element.shadowRoot.querySelector('div');
expect(1).toBe(1);
});
});
3 changes: 3 additions & 0 deletions src/templates/lightningcomponent/lwc/typeScript/typeScript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { LightningElement } from 'lwc';

export default class <%= pascalCaseComponentName %> extends LightningElement {}

0 comments on commit 43277be

Please sign in to comment.