Skip to content

Commit

Permalink
v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
qingmo.xwj committed Jun 17, 2021
1 parent b05bec6 commit 7f2a572
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 61 deletions.
30 changes: 0 additions & 30 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,3 @@
- ✨ create test file if not find ([7a6f6a3](https://github.com/wjgogogo/vscode-find-test-file/commit/7a6f6a3e52dd2834e4d4790ba1fb7df2263e1403))
- ✨ add cfg ([1a1827a](https://github.com/wjgogogo/vscode-find-test-file/commit/1a1827ac05dcf9150e0275fb09045c3701175399))
- ✨ add validate function ([eb00bfe](https://github.com/wjgogogo/vscode-find-test-file/commit/eb00bfe888b3741891b37c2fb57832d5b844ac43))

# 0.2.0 (2021-06-17)

### Bug Fixes

- 🐛 correct default test match ([00f2ec9](https://github.com/wjgogogo/vscode-find-test-file/commit/00f2ec962406a70514ae33db0b046a49d0f540c1))

### Features

- ✨ add creat test file command ([a19d8df](https://github.com/wjgogogo/vscode-find-test-file/commit/a19d8dfdfc92261c8d9b992d0ec794eb7e61880c))
- ✨ add create option when search for test file ([944f01c](https://github.com/wjgogogo/vscode-find-test-file/commit/944f01ce0787847886f39d97a2ca32c47d8995a8))
- ✨ add function of jump to source/test file ([d1715ac](https://github.com/wjgogogo/vscode-find-test-file/commit/d1715acfb1eb7c5fd25e03a9ddfd9b3cdfed46ba))
- ✨ create test file if not find ([7a6f6a3](https://github.com/wjgogogo/vscode-find-test-file/commit/7a6f6a3e52dd2834e4d4790ba1fb7df2263e1403))
- ✨ add cfg ([1a1827a](https://github.com/wjgogogo/vscode-find-test-file/commit/1a1827ac05dcf9150e0275fb09045c3701175399))
- ✨ add validate function ([eb00bfe](https://github.com/wjgogogo/vscode-find-test-file/commit/eb00bfe888b3741891b37c2fb57832d5b844ac43))

# 0.2.0 (2021-06-16)

### Bug Fixes

- 🐛 correct default test match ([00f2ec9](https://github.com/wjgogogo/vscode-find-test-file/commit/00f2ec962406a70514ae33db0b046a49d0f540c1))

### Features

- ✨ add creat test file command ([a19d8df](https://github.com/wjgogogo/vscode-find-test-file/commit/a19d8dfdfc92261c8d9b992d0ec794eb7e61880c))
- ✨ add create option when search for test file ([944f01c](https://github.com/wjgogogo/vscode-find-test-file/commit/944f01ce0787847886f39d97a2ca32c47d8995a8))
- ✨ add function of jump to source/test file ([d1715ac](https://github.com/wjgogogo/vscode-find-test-file/commit/d1715acfb1eb7c5fd25e03a9ddfd9b3cdfed46ba))
- ✨ create test file if not find ([7a6f6a3](https://github.com/wjgogogo/vscode-find-test-file/commit/7a6f6a3e52dd2834e4d4790ba1fb7df2263e1403))
- ✨ add cfg ([1a1827a](https://github.com/wjgogogo/vscode-find-test-file/commit/1a1827ac05dcf9150e0275fb09045c3701175399))
- ✨ add validate function ([eb00bfe](https://github.com/wjgogogo/vscode-find-test-file/commit/eb00bfe888b3741891b37c2fb57832d5b844ac43))
62 changes: 31 additions & 31 deletions src/test/suite/index.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
import * as path from 'path';
import * as Mocha from 'mocha';
import * as glob from 'glob';
import path from "path";
import Mocha from "mocha";
import glob from "glob";

export function run(): Promise<void> {
// Create the mocha test
const mocha = new Mocha({
ui: 'tdd',
color: true
});
// Create the mocha test
const mocha = new Mocha({
ui: "tdd",
color: true,
});

const testsRoot = path.resolve(__dirname, '..');
const testsRoot = path.resolve(__dirname, "..");

return new Promise((c, e) => {
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
if (err) {
return e(err);
}
return new Promise((c, e) => {
glob("**/**.test.js", { cwd: testsRoot }, (err, files) => {
if (err) {
return e(err);
}

// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
// Add files to the test suite
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));

try {
// Run the mocha test
mocha.run(failures => {
if (failures > 0) {
e(new Error(`${failures} tests failed.`));
} else {
c();
}
});
} catch (err) {
console.error(err);
e(err);
}
});
});
try {
// Run the mocha test
mocha.run((failures) => {
if (failures > 0) {
e(new Error(`${failures} tests failed.`));
} else {
c();
}
});
} catch (err) {
console.error(err);
e(err);
}
});
});
}

0 comments on commit 7f2a572

Please sign in to comment.