Skip to content

Commit

Permalink
Add missing empty export to assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiandev committed Nov 10, 2020
1 parent 11b689c commit c98972b
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 11 deletions.
4 changes: 3 additions & 1 deletion test/transformation/arrow_function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export default () => {
const expected = `
() => {
return void 0;
};`;
};
export {};`;

const result = util.transform(input, { noAnnotate: true });

Expand Down
4 changes: 3 additions & 1 deletion test/transformation/as_expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export default () => {
it('should not be asserted if any', () => {
const input = `10 as any`;

const expected = `10;`;
const expected = `10;
export {};`;

const result = util.transform(input);

Expand Down
4 changes: 3 additions & 1 deletion test/transformation/binary_expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ export default () => {

const expected = `
let foo;
foo = 1;`;
foo = 1;
export {};`;

const result = util.transform(input);

Expand Down
4 changes: 3 additions & 1 deletion test/transformation/class_declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export default () => {
it('should not be annotated with noAnnotate', () => {
const input = `class Foo { }`;

const expected = `class Foo { }`;
const expected = `class Foo { }
export {};`;

const result = util.transform(input, { noAnnotate: true });

Expand Down
4 changes: 3 additions & 1 deletion test/transformation/function_declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export default () => {
it('should not be annotated with noAnnotate', () => {
const input = `function foo() { }`;

const expected = `function foo() { }`;
const expected = `function foo() { }
export {};`;

const result = util.transform(input, { noAnnotate: true });

Expand Down
4 changes: 3 additions & 1 deletion test/transformation/function_expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export default () => {
it('should not be annotated with noAnnotate', () => {
const input = `let foo = function() { };`;

const expected = `let foo = function () { };`;
const expected = `let foo = function () { };
export {};`;

const result = util.transform(input, { noAnnotate: true });

Expand Down
6 changes: 4 additions & 2 deletions test/transformation/source_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default () => {
it('should remain empty if containing whitespaces only', () => {
const input = ` `;

const expected = ``;
const expected = `export {};`;

const result = util.transform(input);

Expand All @@ -13,7 +13,9 @@ export default () => {
it('should not import lib if not required', () => {
const input = `let foo = "bar";`;

const expected = `let foo = "bar";`;
const expected = `let foo = "bar";
export {};`;

const result = util.transform(input);

Expand Down
12 changes: 9 additions & 3 deletions test/transformation/variable_declaration_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export default () => {
const expected = `
for (let foo of []) {
}`;
}
export {};`;

const result = util.transform(input);

Expand All @@ -25,7 +27,9 @@ export default () => {
const expected = `
for (let foo in {}) {
}`;
}
export {};`;

const result = util.transform(input);

Expand All @@ -43,7 +47,9 @@ export default () => {
} catch (e) {
}`;
}
export {};`;

const result = util.transform(input);

Expand Down

0 comments on commit c98972b

Please sign in to comment.