Skip to content

Commit 8da608d

Browse files
committed
Reverted some more forgotten stuff
1 parent 12fcf2d commit 8da608d

File tree

5 files changed

+15
-25
lines changed

5 files changed

+15
-25
lines changed

src/bundle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function require(file)
6565
if ____originalRequire then
6666
return ____originalRequire(file)
6767
else
68-
print("Could not find module '" .. file .. "' to require.")
68+
error("module '" .. file .. "' not found")
6969
end
7070
end
7171
end\n`;

test/unit/functions/noImplicitSelfOption.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test("enables noSelfInFile behaviour for functions", () => {
66
const test: (this: void) => void = fooBar;
77
`
88
.setOptions({ noImplicitSelf: true })
9-
.expectToHaveNoErrorDiagnostics();
9+
.expectToHaveNoDiagnostics();
1010
});
1111

1212
test("enables noSelfInFile behaviour for methods", () => {
@@ -18,15 +18,15 @@ test("enables noSelfInFile behaviour for methods", () => {
1818
const test: (this: any) => void = fooBar.fooBar;
1919
`
2020
.setOptions({ noImplicitSelf: true })
21-
.expectToHaveNoErrorDiagnostics();
21+
.expectToHaveNoDiagnostics();
2222
});
2323

2424
test("generates declaration files with @noSelfInFile", () => {
2525
const builder = util.testModule`
2626
export function bar() {}
2727
`
2828
.setOptions({ declaration: true, noImplicitSelf: true })
29-
.expectToHaveNoErrorDiagnostics();
29+
.expectToHaveNoDiagnostics();
3030

3131
const declarationFile = builder.getLuaResult().transpiledFiles.find(f => f.declaration);
3232
if (!util.expectToBeDefined(declarationFile) || !util.expectToBeDefined(declarationFile.declaration)) return;
@@ -36,5 +36,5 @@ test("generates declaration files with @noSelfInFile", () => {
3636
const test: (this: void) => void = bar;
3737
`
3838
.addExtraFile("foo.d.ts", declarationFile.declaration)
39-
.expectToHaveNoErrorDiagnostics();
39+
.expectToHaveNoDiagnostics();
4040
});

test/unit/functions/validation/functionExpressionTypeInference.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test("noSelfInFile works when first statement has other annotations", () => {
2424
function foo() {}
2525
2626
const test: (this: void) => void = foo;
27-
`.expectToHaveNoErrorDiagnostics();
27+
`.expectToHaveNoDiagnostics();
2828
});
2929

3030
test.each(["(this: void, s: string) => string", "(this: any, s: string) => string", "(s: string) => string"])(

test/unit/printer/sourcemaps.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ test.each([
152152
])("Source map has correct mapping (%p)", async ({ code, assertPatterns }) => {
153153
const file = util
154154
.testModule(code)
155-
.expectToHaveNoErrorDiagnostics()
155+
.expectToHaveNoDiagnostics()
156156
.getMainLuaFileResult();
157157

158158
const consumer = await new SourceMapConsumer(file.sourceMap);
@@ -169,7 +169,7 @@ test("Source map has correct sources", async () => {
169169
const file = util.testModule`
170170
const foo = "foo"
171171
`
172-
.expectToHaveNoErrorDiagnostics()
172+
.expectToHaveNoDiagnostics()
173173
.getMainLuaFileResult();
174174

175175
const consumer = await new SourceMapConsumer(file.sourceMap);
@@ -181,7 +181,7 @@ test("Source map has correct source root", async () => {
181181
const file = util.testModule`
182182
const foo = "foo"
183183
`
184-
.expectToHaveNoErrorDiagnostics()
184+
.expectToHaveNoDiagnostics()
185185
.getMainLuaFileResult();
186186

187187
const sourceMap = JSON.parse(file.sourceMap);
@@ -199,7 +199,7 @@ test.each([
199199
])("Source map has correct name mappings (%p)", async ({ code, name }) => {
200200
const file = util
201201
.testModule(code)
202-
.expectToHaveNoErrorDiagnostics()
202+
.expectToHaveNoDiagnostics()
203203
.getMainLuaFileResult();
204204

205205
const consumer = await new SourceMapConsumer(file.sourceMap);

test/util.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -363,21 +363,11 @@ export abstract class TestBuilder {
363363
return this;
364364
}
365365

366-
public expectToHaveNoErrorDiagnostics(): this {
366+
public expectToHaveNoDiagnostics(): this {
367367
expect(this.getLuaDiagnostics()).not.toHaveDiagnostics();
368368
return this;
369369
}
370370

371-
/*public expectExecutionError(message: string): this {
372-
const luaResult = this.getLuaExecutionResult();
373-
if (!(luaResult instanceof ExecutionError)) {
374-
expect(luaResult).toBeInstanceOf(ExecutionError);
375-
} else {
376-
expect(luaResult.message).toContain(message);
377-
}
378-
return this;
379-
}*/
380-
381371
public expectNoExecutionError(): this {
382372
const luaResult = this.getLuaExecutionResult();
383373
if (luaResult instanceof ExecutionError) {
@@ -388,7 +378,7 @@ export abstract class TestBuilder {
388378
}
389379

390380
public expectToMatchJsResult(allowErrors = false): this {
391-
this.expectToHaveNoErrorDiagnostics();
381+
this.expectToHaveNoDiagnostics();
392382
if (!allowErrors) this.expectNoExecutionError();
393383

394384
const luaResult = this.getLuaExecutionResult();
@@ -399,20 +389,20 @@ export abstract class TestBuilder {
399389
}
400390

401391
public expectToEqual(expected: any): this {
402-
this.expectToHaveNoErrorDiagnostics();
392+
this.expectToHaveNoDiagnostics();
403393
const luaResult = this.getLuaExecutionResult();
404394
expect(luaResult).toEqual(expected);
405395
return this;
406396
}
407397

408398
public expectLuaToMatchSnapshot(): this {
409-
this.expectToHaveNoErrorDiagnostics();
399+
this.expectToHaveNoDiagnostics();
410400
expect(this.getMainLuaCodeChunk()).toMatchSnapshot();
411401
return this;
412402
}
413403

414404
public expectResultToMatchSnapshot(): this {
415-
this.expectToHaveNoErrorDiagnostics();
405+
this.expectToHaveNoDiagnostics();
416406
expect(this.getLuaExecutionResult()).toMatchSnapshot();
417407
return this;
418408
}

0 commit comments

Comments
 (0)