Skip to content

Commit 74ba12c

Browse files
committed
test projects?
1 parent 96edec4 commit 74ba12c

File tree

13 files changed

+79
-0
lines changed

13 files changed

+79
-0
lines changed

src/typescript-internal.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ declare module "typescript" {
1717
}
1818

1919
interface CompilerOptions {
20+
build?: boolean;
2021
configFile?: TsConfigSourceFile;
2122
configFilePath?: string;
23+
projectReferences?: string[];
2224
}
2325

2426
interface TypeChecker {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as util from "../util";
2+
import * as path from "path";
3+
4+
test("should transpile all projects with --build", () => {
5+
const solutionDir = path.join(__dirname, "project-references", "project-references");
6+
const projectDir= path.join(solutionDir, "project1");
7+
const { transpiledFiles } = util
8+
.testProject(path.join(solutionDir, "tsconfig.json"))
9+
.setMainFileName(path.join(projectDir, "index.ts"))
10+
.setOptions({ build: true })
11+
.expectToHaveNoDiagnostics()
12+
.getLuaResult();
13+
14+
console.log(transpiledFiles);
15+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { foo } from "../project2";
2+
3+
export { foo };
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"rootDir": ".."
5+
},
6+
"include": ["**/*.ts", "../project2/**/*.ts"]
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export declare const foo = "foo";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const foo = "foo";
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"rootDir": ".."
5+
},
6+
"include": ["**/*.ts"]
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"files": [],
3+
"include": [],
4+
"references": [
5+
{ "path": "../project1" },
6+
{ "path": "../project2" }
7+
]
8+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"use strict";
2+
exports.__esModule = true;
3+
exports.result = void 0;
4+
exports.result = getNumber();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function getNumber(): number {
2+
return 100;
3+
}

0 commit comments

Comments
 (0)