Skip to content

Commit

Permalink
fix(types/mocha): change deprecated Mocha types (#39573)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tarasyuk committed Jul 13, 2020
1 parent 87fd182 commit 31f75fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/testRunner/externalCompileRunner.ts
Expand Up @@ -30,7 +30,7 @@ namespace Harness {

// eslint-disable-next-line @typescript-eslint/no-this-alias
const cls = this;
describe(`${this.kind()} code samples`, function (this: Mocha.ISuiteCallbackContext) {
describe(`${this.kind()} code samples`, function (this: Mocha.Suite) {
this.timeout(600_000); // 10 minutes
for (const test of testList) {
cls.runTest(typeof test === "string" ? test : test.file);
Expand All @@ -41,7 +41,7 @@ namespace Harness {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const cls = this;
const timeout = 600_000; // 10 minutes
describe(directoryName, function (this: Mocha.ISuiteCallbackContext) {
describe(directoryName, function (this: Mocha.Suite) {
this.timeout(timeout);
const cp: typeof import("child_process") = require("child_process");

Expand Down Expand Up @@ -127,7 +127,7 @@ ${stripAbsoluteImportPaths(result.stderr.toString().replace(/\r\n/g, "\n"))}`;

// eslint-disable-next-line @typescript-eslint/no-this-alias
const cls = this;
describe(`${this.kind()} code samples`, function (this: Mocha.ISuiteCallbackContext) {
describe(`${this.kind()} code samples`, function (this: Mocha.Suite) {
this.timeout(cls.timeout); // 20 minutes
before(() => {
cls.exec("docker", ["build", ".", "-t", "typescript/typescript"], { cwd: IO.getWorkspaceRoot() }); // cached because workspace is hashed to determine cacheability
Expand Down
4 changes: 2 additions & 2 deletions src/testRunner/rwcRunner.ts
Expand Up @@ -47,7 +47,7 @@ namespace RWC {
caseSensitive = false;
});

it("can compile", function (this: Mocha.ITestCallbackContext) {
it("can compile", function (this: Mocha.Context) {
this.timeout(800_000); // Allow long timeouts for RWC compilations
let opts!: ts.ParsedCommandLine;

Expand Down Expand Up @@ -145,7 +145,7 @@ namespace RWC {
});


it("has the expected emitted code", function (this: Mocha.ITestCallbackContext) {
it("has the expected emitted code", function (this: Mocha.Context) {
this.timeout(100_000); // Allow longer timeouts for RWC js verification
Harness.Baseline.runMultifileBaseline(baseName, "", () => {
return Harness.Compiler.iterateOutputs(compilerResult.js.values());
Expand Down

0 comments on commit 31f75fe

Please sign in to comment.