Skip to content

Commit 5183dba

Browse files
authored
Merge pull request #578 from typed-ember/bye-jest
2 parents f8c4213 + bea2107 commit 5183dba

20 files changed

+857
-1575
lines changed

packages/environment-ember-template-imports/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
*.d.ts
33
tsconfig.tsbuildinfo
44

5-
!jest.config.js
65
!-private/dsl/**/*.d.ts
76
!globals/**/*.d.ts

packages/template/__tests__/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"extends": "../../../tsconfig.compileroptions.json",
33
"compilerOptions": {
44
"noEmit": true,
5-
"lib": ["dom"]
5+
"lib": ["es2020", "dom"]
66
}
77
}

packages/vscode/.vscodeignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@ lib/
1212
tsconfig.json
1313
tsconfig.tsbuildinfo
1414

15-
jest.config.mjs
16-
1715
node_modules/

packages/vscode/__tests__/smoketest-ember.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import {
1212
workspace,
1313
} from 'vscode';
1414
import * as path from 'path';
15+
import { describe, afterEach, test } from 'mocha';
16+
import { expect } from 'expect';
1517
import { waitUntil } from './helpers/async';
1618

1719
describe('Smoke test: Ember', () => {
18-
jest.setTimeout(30_000);
19-
20-
const rootDir = path.resolve(__dirname, '../__fixtures__/ember-app');
20+
const rootDir = path.resolve(__dirname, '../../__fixtures__/ember-app');
2121

2222
afterEach(async () => {
2323
while (window.activeTextEditor) {

packages/vscode/__tests__/smoketest-js-glimmerx.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import {
1010
workspace,
1111
} from 'vscode';
1212
import * as path from 'path';
13+
import { describe, afterEach, test } from 'mocha';
14+
import { expect } from 'expect';
1315
import { waitUntil } from './helpers/async';
1416

1517
describe('Smoke test: js-glimmerx', () => {
16-
jest.setTimeout(30_000);
17-
18-
const rootDir = path.resolve(__dirname, '../__fixtures__/js-glimmerx-app');
18+
const rootDir = path.resolve(__dirname, '../../__fixtures__/js-glimmerx-app');
1919

2020
afterEach(async () => {
2121
while (window.activeTextEditor) {

packages/vscode/__tests__/smoketest-template-imports.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import {
1010
workspace,
1111
} from 'vscode';
1212
import * as path from 'path';
13+
import { describe, afterEach, test } from 'mocha';
14+
import { expect } from 'expect';
1315
import { waitUntil } from './helpers/async';
1416

1517
describe('Smoke test: ETI Environment', () => {
16-
jest.setTimeout(30_000);
17-
18-
const rootDir = path.resolve(__dirname, '../__fixtures__/template-imports-app');
18+
const rootDir = path.resolve(__dirname, '../../__fixtures__/template-imports-app');
1919

2020
afterEach(async () => {
2121
while (window.activeTextEditor) {

packages/vscode/__tests__/support/launch-from-cli.mjs renamed to packages/vscode/__tests__/support/launch-from-cli.mts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
// @ts-check
2-
3-
import path from 'node:path';
4-
import os from 'node:os';
1+
import * as path from 'node:path';
2+
import * as os from 'node:os';
53
import { fileURLToPath } from 'node:url';
64
import { runTests } from '@vscode/test-electron';
75

86
const dirname = path.dirname(fileURLToPath(import.meta.url));
7+
const packageRoot = path.resolve(dirname, '../../..');
98
const emptyTempDir = path.join(os.tmpdir(), `user-data-${Math.random()}`);
109

1110
try {
1211
await runTests({
13-
extensionDevelopmentPath: path.resolve(dirname, '../..'),
14-
extensionTestsPath: path.resolve(dirname, 'vscode-runner.cjs'),
12+
extensionDevelopmentPath: packageRoot,
13+
extensionTestsPath: path.resolve(dirname, 'vscode-runner.js'),
1514
launchArgs: [
1615
// Don't show the "hey do you trust this folder?" prompt
1716
'--disable-workspace-trust',
@@ -25,9 +24,9 @@ try {
2524
'--user-data-dir',
2625
emptyTempDir,
2726
// Load the app fixtures
28-
`${dirname}/../../__fixtures__/ember-app`,
29-
`${dirname}/../../__fixtures__/js-glimmerx-app`,
30-
`${dirname}/../../__fixtures__/template-imports-app`,
27+
`${packageRoot}/__fixtures__/ember-app`,
28+
`${packageRoot}/__fixtures__/js-glimmerx-app`,
29+
`${packageRoot}/__fixtures__/template-imports-app`,
3130
],
3231
});
3332
} catch (error) {

packages/vscode/__tests__/support/vscode-jest-environment.cjs

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/vscode/__tests__/support/vscode-runner.cjs

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// This file is invoked by VSCode itself when configured to run extension
2+
// tests via the `--extensionTestsPath` flag.
3+
4+
import * as path from 'node:path';
5+
import * as glob from 'glob';
6+
import Mocha = require('mocha');
7+
8+
export function run(runner: unknown, callback: (error: unknown, failures?: number) => void): void {
9+
try {
10+
let mocha = new Mocha({ color: true, slow: 3_000, timeout: 30_000 });
11+
let tests = path.resolve(__dirname, '..').replace(/\\/g, '/');
12+
13+
for (let testFile of glob.sync(`${tests}/**/*.test.js`)) {
14+
if (process.platform === 'win32') {
15+
// Mocha is weird about drive letter casing under Windows
16+
testFile = testFile[0].toLowerCase() + testFile.slice(1);
17+
}
18+
19+
mocha.addFile(testFile);
20+
}
21+
22+
mocha.run((failures) => callback(null, failures));
23+
} catch (error) {
24+
console.error(error);
25+
callback(error);
26+
}
27+
}

0 commit comments

Comments
 (0)