ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
18 lines (16 loc) • 667 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const testHelpers_1 = require("./../compiler/testHelpers");
describe("tests for issue #38", () => {
it("should set the initializer when it's a string", () => {
const text = `class Identifier {
public static readonly Version: string = "1.0";
}`;
const { firstChild } = testHelpers_1.getInfoFromText(text);
const prop = firstChild.getStaticProperties()[0];
prop.setInitializer(`"2.0"`);
chai_1.expect(firstChild.getFullText()).to.equal(text.replace("1", "2"));
});
});
//# sourceMappingURL=38tests.js.map