mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
* Add definitions for atom-mocha-test-runner. * Remove the editorconfig. * Atom: remove editorconfigs, linebreak-style, and all lint disables.
39 lines
965 B
TypeScript
39 lines
965 B
TypeScript
import { createRunner } from "atom-mocha-test-runner";
|
|
import defaultMochaRunner = require("atom-mocha-test-runner");
|
|
|
|
const extraOptions = {
|
|
testSuffixes: ["-spec.js", "-spec.coffee"],
|
|
};
|
|
|
|
function mochaSetup(mocha: Mocha) {
|
|
mocha.addFile("test.file");
|
|
}
|
|
|
|
let testRunner = createRunner();
|
|
testRunner = createRunner(extraOptions);
|
|
testRunner = createRunner(extraOptions, mochaSetup);
|
|
testRunner = createRunner({
|
|
colors: true,
|
|
globalAtom: true,
|
|
htmlTitle: "Test Title",
|
|
reporter: "dot",
|
|
testSuffixes: ["test.file"],
|
|
});
|
|
|
|
declare const atom: Atom.AtomEnvironment;
|
|
declare const blob: object;
|
|
declare let num: number;
|
|
|
|
async function runTests(): Promise<number> {
|
|
const runnerArgs: Atom.Structures.TestRunnerArgs = {
|
|
testPaths: ["/var/test"],
|
|
logFile: "/var/log",
|
|
headless: false,
|
|
buildDefaultApplicationDelegate: () => blob,
|
|
buildAtomEnvironment: () => atom,
|
|
};
|
|
|
|
num = await defaultMochaRunner(runnerArgs);
|
|
return await testRunner(runnerArgs);
|
|
}
|