mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-12-04 00:54:52 +00:00
Replace mocha with a custom test runner
This commit is contained in:
parent
4691a0647b
commit
76b3d437d3
5 changed files with 185 additions and 1175 deletions
|
|
@ -1,24 +1,24 @@
|
|||
import * as assert from 'assert';
|
||||
import { Cargo } from '../../src/toolchain';
|
||||
import { Context } from '.';
|
||||
|
||||
suite('Launch configuration', () => {
|
||||
|
||||
suite('Lens', () => {
|
||||
test('A binary', async () => {
|
||||
export async function getTests(ctx: Context) {
|
||||
await ctx.suite('Launch configuration/Lens', suite => {
|
||||
suite.addTest('A binary', async () => {
|
||||
const args = Cargo.artifactSpec(["build", "--package", "pkg_name", "--bin", "pkg_name"]);
|
||||
|
||||
assert.deepStrictEqual(args.cargoArgs, ["build", "--package", "pkg_name", "--bin", "pkg_name", "--message-format=json"]);
|
||||
assert.deepStrictEqual(args.filter, undefined);
|
||||
});
|
||||
|
||||
test('One of Multiple Binaries', async () => {
|
||||
suite.addTest('One of Multiple Binaries', async () => {
|
||||
const args = Cargo.artifactSpec(["build", "--package", "pkg_name", "--bin", "bin1"]);
|
||||
|
||||
assert.deepStrictEqual(args.cargoArgs, ["build", "--package", "pkg_name", "--bin", "bin1", "--message-format=json"]);
|
||||
assert.deepStrictEqual(args.filter, undefined);
|
||||
});
|
||||
|
||||
test('A test', async () => {
|
||||
suite.addTest('A test', async () => {
|
||||
const args = Cargo.artifactSpec(["test", "--package", "pkg_name", "--lib", "--no-run"]);
|
||||
|
||||
assert.deepStrictEqual(args.cargoArgs, ["test", "--package", "pkg_name", "--lib", "--no-run", "--message-format=json"]);
|
||||
|
|
@ -26,8 +26,8 @@ suite('Launch configuration', () => {
|
|||
});
|
||||
});
|
||||
|
||||
suite('QuickPick', () => {
|
||||
test('A binary', async () => {
|
||||
await ctx.suite('Launch configuration/QuickPick', suite => {
|
||||
suite.addTest('A binary', async () => {
|
||||
const args = Cargo.artifactSpec(["run", "--package", "pkg_name", "--bin", "pkg_name"]);
|
||||
|
||||
assert.deepStrictEqual(args.cargoArgs, ["build", "--package", "pkg_name", "--bin", "pkg_name", "--message-format=json"]);
|
||||
|
|
@ -35,18 +35,18 @@ suite('Launch configuration', () => {
|
|||
});
|
||||
|
||||
|
||||
test('One of Multiple Binaries', async () => {
|
||||
suite.addTest('One of Multiple Binaries', async () => {
|
||||
const args = Cargo.artifactSpec(["run", "--package", "pkg_name", "--bin", "bin2"]);
|
||||
|
||||
assert.deepStrictEqual(args.cargoArgs, ["build", "--package", "pkg_name", "--bin", "bin2", "--message-format=json"]);
|
||||
assert.deepStrictEqual(args.filter, undefined);
|
||||
});
|
||||
|
||||
test('A test', async () => {
|
||||
suite.addTest('A test', async () => {
|
||||
const args = Cargo.artifactSpec(["test", "--package", "pkg_name", "--lib"]);
|
||||
|
||||
assert.deepStrictEqual(args.cargoArgs, ["test", "--package", "pkg_name", "--lib", "--message-format=json", "--no-run"]);
|
||||
assert.notDeepStrictEqual(args.filter, undefined);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue