Skip to content

Commit

Permalink
drop --parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
gjf7 committed Oct 16, 2024
1 parent 8a8bc2e commit 265382e
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/neovim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"scripts": {
"doc": "typedoc --out doc --exclude '**/*.test.ts' src",
"prepublishOnly": "npm run build",
"test": "mocha --exit --parallel --require ts-node/register --require src/testSetup.ts src/**/*.test.ts",
"test": "mocha --exit --require ts-node/register --require src/testSetup.ts src/**/*.test.ts",
"test-coverage": "c8 --reporter=json --reporter=html npm test",
"test-staged": "npm test --bail",
"test-missing-apis": "npm run build && node scripts/findMissingApi",
Expand Down
12 changes: 11 additions & 1 deletion packages/neovim/src/api/Neovim.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import * as path from 'node:path';
import assert from 'node:assert';
import expect from 'expect';
import { nvim } from '../testUtil';
import * as testUtil from '../testUtil';

describe('Neovim API', () => {
let nvim: ReturnType<typeof testUtil.startNvim>[1];

before(async () => {
[, nvim] = testUtil.startNvim();
});

after(() => {
testUtil.stopNvim();
});

describe('Normal API calls', () => {
it('gets a list of buffers and switches buffers', async () => {
const buffers = await nvim.buffers;
Expand Down
12 changes: 11 additions & 1 deletion packages/neovim/src/api/Tabpage.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import * as jestMock from 'jest-mock';
import expect from 'expect';
import { nvim } from '../testUtil';
import * as testUtil from '../testUtil';
import type { Tabpage } from './Tabpage';

describe('Tabpage API', () => {
let nvim: ReturnType<typeof testUtil.startNvim>[1];

before(async () => {
[, nvim] = testUtil.startNvim();
});

after(() => {
testUtil.stopNvim();
});

it('gets the current Tabpage', async () => {
const tabpage = await nvim.tabpage;
expect(tabpage).toBeInstanceOf(nvim.Tabpage);
Expand Down
12 changes: 11 additions & 1 deletion packages/neovim/src/api/Window.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import assert from 'node:assert';
import expect from 'expect';
import { nvim } from '../testUtil';
import * as testUtil from '../testUtil';
import type { Window } from './Window';

describe('Window API', () => {
let nvim: ReturnType<typeof testUtil.startNvim>[1];

before(async () => {
[, nvim] = testUtil.startNvim();
});

after(() => {
testUtil.stopNvim();
});

it('gets the current Window', async () => {
const win = await nvim.window;
expect(win).toBeInstanceOf(nvim.Window);
Expand Down
17 changes: 14 additions & 3 deletions packages/neovim/src/attach/attach.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@ import * as jestMock from 'jest-mock';
import expect from 'expect';
import { attach } from './attach';
import { Logger } from '../utils/logger';
import { proc, nvim, startNvim, stopNvim } from '../testUtil';
import * as testUtil from '../testUtil';
import { NeovimClient } from '../api/client';

// global.expect = expect;

describe('Nvim API', () => {
let proc: ReturnType<typeof testUtil.startNvim>[0];
let nvim: ReturnType<typeof testUtil.startNvim>[1];

before(async () => {
[proc, nvim] = testUtil.startNvim();
});

after(() => {
testUtil.stopNvim();
});

let requests: { method: string; args: number[] }[];
let notifications: { method: string; args: number[] }[];

Expand Down Expand Up @@ -54,7 +65,7 @@ describe('Nvim API', () => {
});

it('console.log NOT monkey-patched if custom logger passed to attach()', async () => {
const [proc2] = startNvim(false);
const [proc2] = testUtil.startNvim(false);
const logged: string[] = [];
let logger2 = {};
const fakeLog = (msg: any) => {
Expand Down Expand Up @@ -87,7 +98,7 @@ describe('Nvim API', () => {
// Still alive?
expect(await nvim2.eval('1+1')).toEqual(2);

stopNvim(nvim2);
testUtil.stopNvim(nvim2);
});

it('can send requests and receive response', async () => {
Expand Down

0 comments on commit 265382e

Please sign in to comment.