Skip to content

Commit

Permalink
Re-enable TypeScript self-test
Browse files Browse the repository at this point in the history
The latest release of zodern:types is able to pull type declarations
from a Meteor checkout, if it's being used, instead of only from the
package repository (which may not contain the latest changes). This
means that we should be able to re-enable the TypeScript test, which
verifies that the TypeScript skeleton does, in fact, produce a project
which passes type checking.

(Re-enabling the test also picked up a few latent bugs in the type
declarations, so fix those as well)
  • Loading branch information
ebroder committed Dec 23, 2023
1 parent 9425d5e commit b12ba90
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion packages/logging/logging.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type LogJSONInput = {
message: string;
app?: string;
[index: string]: string | object | number;
[index: string]: string | object | number | undefined;
};

type LogInput = string | LogJSONInput;
Expand Down
2 changes: 1 addition & 1 deletion packages/meteor/meteor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export namespace Meteor {
>(
name: string,
args: ReadonlyArray<EJSONable | EJSONableProperty>,
options?: MethodApplyOptions,
options?: MethodApplyOptions<Result>,
asyncCallback?: (
error: global_Error | Meteor.Error | undefined,
result?: Result
Expand Down
54 changes: 27 additions & 27 deletions tools/tests/typescript.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
// var selftest = require('../tool-testing/selftest.js');
// var Sandbox = selftest.Sandbox;
//
// selftest.define("typescript template works", function () {
// const s = new Sandbox;
//
// let run = s.run("create", "--typescript", "typescript");
//
// run.waitSecs(60);
// run.match("Created a new Meteor app in 'typescript'.");
// run.match("To run your new app");
//
// s.cd("typescript");
//
// run = s.run("npm", "install");
// run.expectExit(0);
//
// run = s.run("lint");
// run.waitSecs(60);
// run.match("[zodern:types] Exiting \"meteor lint\" early");
// run.expectExit(0);
//
// run = s.run("npx", "tsc");
// run.waitSecs(60);
// run.expectEnd();
// run.expectExit(0);
// });
var selftest = require('../tool-testing/selftest.js');
var Sandbox = selftest.Sandbox;

selftest.define("typescript template works", function () {
const s = new Sandbox;

let run = s.run("create", "--typescript", "typescript");

run.waitSecs(60);
run.match("Created a new Meteor app in 'typescript'.");
run.match("To run your new app");

s.cd("typescript");

run = s.run("npm", "install");
run.expectExit(0);

run = s.run("lint");
run.waitSecs(60);
run.match("[zodern:types] Exiting \"meteor lint\" early");
run.expectExit(0);

run = s.run("npx", "tsc");
run.waitSecs(60);
run.expectEnd();
run.expectExit(0);
});

0 comments on commit b12ba90

Please sign in to comment.