Skip to content

Commit

Permalink
test: correct type error for build cases
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Sep 7, 2023
1 parent 200d208 commit 973e231
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 29 deletions.
14 changes: 2 additions & 12 deletions tests/fixtures/build/bundle-alias-tsconfig/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"module": "commonjs",
"moduleResolution": "node",
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true,
"skipLibCheck": true,
"target": "es2015",
"jsx": "react",
"baseUrl": ".",
"baseUrl": "./",
"paths": {
"alias-module": ["./src/alias.ts"],
"@/*": ["./src/*"],
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/build/bundle-targets/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ async function hello() {
return await Promise.resolve('ok');
}

hello();
export default hello;
3 changes: 1 addition & 2 deletions tests/fixtures/build/bundless-alias/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"strict": true,
"declaration": true,
"skipLibCheck": true,
"baseUrl": "./",
"paths": {
"@/*": ["./src/*"],
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/build/bundless-babel-targets/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ async function hello() {
return await Promise.resolve('ok');
}

hello();
export default hello;
1 change: 1 addition & 0 deletions tests/fixtures/build/bundless-diff-dts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"declaration": true
}
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/build/bundless-esbuild-targets/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ async function hello() {
return await Promise.resolve('ok');
}

hello();
export default hello;
2 changes: 1 addition & 1 deletion tests/fixtures/build/bundless-include-dts/expect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default (files: Record<string, string>) => {
// expect global types to be included
expect(files['esm/index.d.js']).toContain(': string;');
expect(files['esm/index.d.ts']).toContain(': string;');
};
4 changes: 3 additions & 1 deletion tests/fixtures/build/bundless-include-dts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"extends": "../tsconfig.json",
"include": ["global.d.ts", "src/**/*.ts"]
"compilerOptions": {
"declaration": true
}
}
5 changes: 2 additions & 3 deletions tests/fixtures/build/bundless-outer-paths/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"strict": true,
"skipLibCheck": true,
"declaration": true,
"baseUrl": ".",
"baseUrl": "./",
"paths": {
"@bundless-overrides": ["../bundless-overrides/src/client"]
}
Expand Down
3 changes: 1 addition & 2 deletions tests/fixtures/build/bundless-swc-alias/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"strict": true,
"declaration": true,
"skipLibCheck": true,
"baseUrl": "./",
"paths": {
"@/*": ["./src/*"],
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/build/bundless-swc-targets/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ async function hello() {
return await Promise.resolve('ok');
}

hello();
export default hello;
7 changes: 3 additions & 4 deletions tests/fixtures/build/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"strict": true,
"skipLibCheck": true,
"jsx": "react"
},
"include": ["**/*.ts", "**/*.tsx"]
}
}

0 comments on commit 973e231

Please sign in to comment.