-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: #312 - StatementedNode uses inconsistent source for child count.
- Loading branch information
Showing
2 changed files
with
27 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { expect } from "chai"; | ||
import { ClassDeclaration } from "../../compiler"; | ||
import { getInfoFromText } from "../compiler/testHelpers"; | ||
|
||
describe("tests for issue #312", () => { | ||
it("should still correctly add a function when the syntax is wrong like this", () => { | ||
const text = ` | ||
export type compilerVersions = "2.8.1" | "2.6.2" | "2.7.2"; | ||
export enum CompilerVersion { | ||
typescript = "2.8.1", | ||
typescript-2.6.2 = "2.6.2", | ||
typescript-2.7.2 = "2.7.2" | ||
}`; | ||
const { sourceFile } = getInfoFromText(text); | ||
expect(() => sourceFile.addFunction({ name: "func" })).to.not.throw(); | ||
}); | ||
}); |