Skip to content

Commit b681785

Browse files
committed
Fix more tests
1 parent dca1bdb commit b681785

File tree

8 files changed

+49
-69
lines changed

8 files changed

+49
-69
lines changed

internal/execute/testsys_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func (s *testSys) reportFSEntryDiff(baseline io.Writer, newDirContent *diffEntry
233233
} else if newDirContent == nil {
234234
fmt.Fprint(baseline, "//// [", path, "] *deleted*\n")
235235
} else if newDirContent.content != oldDirContent.content {
236-
fmt.Fprint(baseline, "//// [", path, "] *modified* \n", newDirContent, "\n")
236+
fmt.Fprint(baseline, "//// [", path, "] *modified* \n", newDirContent.content, "\n")
237237
} else if newDirContent.fileInfo.ModTime() != oldDirContent.fileInfo.ModTime() {
238238
fmt.Fprint(baseline, "//// [", path, "] *modified time*\n")
239239
} else if defaultLibs != nil && defaultLibs.Has(path) && s.fs.defaultLibs != nil && !s.fs.defaultLibs.Has(path) {

internal/execute/tsc_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package execute_test
22

33
import (
44
"testing"
5-
6-
"github.com/microsoft/typescript-go/internal/bundled"
75
)
86

97
func TestTsc(t *testing.T) {
@@ -206,11 +204,6 @@ func TestExtends(t *testing.T) {
206204

207205
func TestTypeAcquisition(t *testing.T) {
208206
t.Parallel()
209-
if !bundled.Embedded {
210-
// Without embedding, we'd need to read all of the lib files out from disk into the MapFS.
211-
// Just skip this for now.
212-
t.Skip("bundled files are not embedded")
213-
}
214207
(&tscInput{
215208
subScenario: "parse tsconfig with typeAcquisition",
216209
sys: newTestSys(FileMap{"/home/src/workspaces/project/tsconfig.json": `{

internal/execute/verifytsc_nocheck_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package execute_test
22

33
import (
44
"testing"
5-
6-
"github.com/microsoft/typescript-go/internal/bundled"
75
)
86

97
type noCheckScenario struct {
@@ -13,11 +11,6 @@ type noCheckScenario struct {
1311

1412
func TestNoCheck(t *testing.T) {
1513
t.Parallel()
16-
if !bundled.Embedded {
17-
// Without embedding, we'd need to read all of the lib files out from disk into the MapFS.
18-
// Just skip this for now.
19-
t.Skip("bundled files are not embedded")
20-
}
2114
cases := []noCheckScenario{
2215
{"syntax errors", `export const a = "hello`},
2316
{"semantic errors", `export const a: number = "hello";`},

internal/execute/verifytscwatch_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"strings"
66
"testing"
77

8-
"github.com/microsoft/typescript-go/internal/bundled"
98
"github.com/microsoft/typescript-go/internal/execute"
109
"github.com/microsoft/typescript-go/internal/testutil/baseline"
1110
)
@@ -117,11 +116,6 @@ func newTscEdit(name string, edit func(sys execute.System)) *testTscEdit {
117116

118117
func TestTscNoEmitWatch(t *testing.T) {
119118
t.Parallel()
120-
if !bundled.Embedded {
121-
// Without embedding, we'd need to read all of the lib files out from disk into the MapFS.
122-
// Just skip this for now.
123-
t.Skip("bundled files are not embedded")
124-
}
125119

126120
testCases := []*tscInput{
127121
noEmitWatchTestInput("syntax errors",

testdata/baselines/reference/tscWatch/noEmit/dts-errors-without-dts-enabled.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Edit:: fix syntax error
4949

5050
Output::
5151
//// [/home/src/workspaces/project/a.ts] *modified*
52-
&{const a = "hello"; 0xc001650540}
52+
const a = "hello";
5353

5454

5555

@@ -60,60 +60,60 @@ Output::
6060
const a = "hello";
6161

6262
//// [/home/src/workspaces/project/tsconfig.json] *modified*
63-
&{{
63+
{
6464
"compilerOptions": {
6565

6666
}
67-
} 0xc00132e7b0}
67+
}
6868

6969

7070

7171
Edit:: no emit run after fixing error
7272

7373
Output::
7474
//// [/home/src/workspaces/project/tsconfig.json] *modified*
75-
&{{
75+
{
7676
"compilerOptions": {
7777
"noEmit": true,
7878

7979
}
80-
} 0xc0005670b0}
80+
}
8181

8282

8383

8484
Edit:: introduce error
8585

8686
Output::
8787
//// [/home/src/workspaces/project/a.ts] *modified*
88-
&{const a = class { private p = 10; }; 0xc0010f0f00}
88+
const a = class { private p = 10; };
8989

9090

9191

9292
Edit:: emit when error
9393

9494
Output::
9595
//// [/home/src/workspaces/project/a.js] *modified*
96-
&{const a = class {
96+
const a = class {
9797
p = 10;
9898
};
99-
0xc000a67bc0}
99+
100100
//// [/home/src/workspaces/project/tsconfig.json] *modified*
101-
&{{
101+
{
102102
"compilerOptions": {
103103

104104
}
105-
} 0xc000a67c20}
105+
}
106106

107107

108108

109109
Edit:: no emit run when error
110110

111111
Output::
112112
//// [/home/src/workspaces/project/tsconfig.json] *modified*
113-
&{{
113+
{
114114
"compilerOptions": {
115115
"noEmit": true,
116116

117117
}
118-
} 0xc000df9a70}
118+
}
119119

testdata/baselines/reference/tscWatch/noEmit/dts-errors.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Edit:: fix syntax error
6262

6363
Output::
6464
//// [/home/src/workspaces/project/a.ts] *modified*
65-
&{const a = "hello"; 0xc000e6cba0}
65+
const a = "hello";
6666

6767

6868

@@ -76,24 +76,24 @@ declare const a = "hello";
7676
const a = "hello";
7777

7878
//// [/home/src/workspaces/project/tsconfig.json] *modified*
79-
&{{
79+
{
8080
"compilerOptions": {
8181
"declaration": true
8282
}
83-
} 0xc000f2c600}
83+
}
8484

8585

8686

8787
Edit:: no emit run after fixing error
8888

8989
Output::
9090
//// [/home/src/workspaces/project/tsconfig.json] *modified*
91-
&{{
91+
{
9292
"compilerOptions": {
9393
"noEmit": true,
9494
"declaration": true
9595
}
96-
} 0xc00070ed50}
96+
}
9797

9898

9999

@@ -113,7 +113,7 @@ Output::
113113
Found 1 error in a.ts:1
114114

115115
//// [/home/src/workspaces/project/a.ts] *modified*
116-
&{const a = class { private p = 10; }; 0xc0009e7d10}
116+
const a = class { private p = 10; };
117117

118118

119119

@@ -133,23 +133,23 @@ Output::
133133
Found 1 error in a.ts:1
134134

135135
//// [/home/src/workspaces/project/a.d.ts] *modified*
136-
&{declare const a: {
136+
declare const a: {
137137
new (): {
138138
p: number;
139139
};
140140
};
141-
0xc000811200}
141+
142142
//// [/home/src/workspaces/project/a.js] *modified*
143-
&{const a = class {
143+
const a = class {
144144
p = 10;
145145
};
146-
0xc000811230}
146+
147147
//// [/home/src/workspaces/project/tsconfig.json] *modified*
148-
&{{
148+
{
149149
"compilerOptions": {
150150
"declaration": true
151151
}
152-
} 0xc0008112f0}
152+
}
153153

154154

155155

@@ -169,10 +169,10 @@ Output::
169169
Found 1 error in a.ts:1
170170

171171
//// [/home/src/workspaces/project/tsconfig.json] *modified*
172-
&{{
172+
{
173173
"compilerOptions": {
174174
"noEmit": true,
175175
"declaration": true
176176
}
177-
} 0xc000ac69f0}
177+
}
178178

testdata/baselines/reference/tscWatch/noEmit/semantic-errors.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Edit:: fix syntax error
5757

5858
Output::
5959
//// [/home/src/workspaces/project/a.ts] *modified*
60-
&{const a = "hello"; 0xc001001350}
60+
const a = "hello";
6161

6262

6363

@@ -68,24 +68,24 @@ Output::
6868
const a = "hello";
6969

7070
//// [/home/src/workspaces/project/tsconfig.json] *modified*
71-
&{{
71+
{
7272
"compilerOptions": {
7373

7474
}
75-
} 0xc0002f0990}
75+
}
7676

7777

7878

7979
Edit:: no emit run after fixing error
8080

8181
Output::
8282
//// [/home/src/workspaces/project/tsconfig.json] *modified*
83-
&{{
83+
{
8484
"compilerOptions": {
8585
"noEmit": true,
8686

8787
}
88-
} 0xc000f2ce40}
88+
}
8989

9090

9191

@@ -101,7 +101,7 @@ Output::
101101
Found 1 error in a.ts:1
102102

103103
//// [/home/src/workspaces/project/a.ts] *modified*
104-
&{const a: number = "hello" 0xc00100bc80}
104+
const a: number = "hello"
105105

106106

107107

@@ -118,11 +118,11 @@ Found 1 error in a.ts:1
118118

119119
//// [/home/src/workspaces/project/a.js] *modified time*
120120
//// [/home/src/workspaces/project/tsconfig.json] *modified*
121-
&{{
121+
{
122122
"compilerOptions": {
123123

124124
}
125-
} 0xc000b51d40}
125+
}
126126

127127

128128

@@ -138,10 +138,10 @@ Output::
138138
Found 1 error in a.ts:1
139139

140140
//// [/home/src/workspaces/project/tsconfig.json] *modified*
141-
&{{
141+
{
142142
"compilerOptions": {
143143
"noEmit": true,
144144

145145
}
146-
} 0xc000ee2e70}
146+
}
147147

testdata/baselines/reference/tscWatch/noEmit/syntax-errors.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Edit:: fix syntax error
5757

5858
Output::
5959
//// [/home/src/workspaces/project/a.ts] *modified*
60-
&{const a = "hello"; 0xc000e43ef0}
60+
const a = "hello";
6161

6262

6363

@@ -68,24 +68,24 @@ Output::
6868
const a = "hello";
6969

7070
//// [/home/src/workspaces/project/tsconfig.json] *modified*
71-
&{{
71+
{
7272
"compilerOptions": {
7373

7474
}
75-
} 0xc0001e8330}
75+
}
7676

7777

7878

7979
Edit:: no emit run after fixing error
8080

8181
Output::
8282
//// [/home/src/workspaces/project/tsconfig.json] *modified*
83-
&{{
83+
{
8484
"compilerOptions": {
8585
"noEmit": true,
8686

8787
}
88-
} 0xc0007ae300}
88+
}
8989

9090

9191

@@ -101,7 +101,7 @@ Output::
101101
Found 1 error in a.ts:1
102102

103103
//// [/home/src/workspaces/project/a.ts] *modified*
104-
&{const a = "hello 0xc000cd0db0}
104+
const a = "hello
105105

106106

107107

@@ -117,14 +117,14 @@ Output::
117117
Found 1 error in a.ts:1
118118

119119
//// [/home/src/workspaces/project/a.js] *modified*
120-
&{const a = "hello;
121-
0xc001665620}
120+
const a = "hello;
121+
122122
//// [/home/src/workspaces/project/tsconfig.json] *modified*
123-
&{{
123+
{
124124
"compilerOptions": {
125125

126126
}
127-
} 0xc001665680}
127+
}
128128

129129

130130

@@ -140,10 +140,10 @@ Output::
140140
Found 1 error in a.ts:1
141141

142142
//// [/home/src/workspaces/project/tsconfig.json] *modified*
143-
&{{
143+
{
144144
"compilerOptions": {
145145
"noEmit": true,
146146

147147
}
148-
} 0xc00133c870}
148+
}
149149

0 commit comments

Comments
 (0)