Skip to content

Commit

Permalink
Run tests in VS Code
Browse files Browse the repository at this point in the history
This change runs unit tests inside of VS Code, making it possible to set
breakpoints and debug test, and to let tests access VS Code services. In
addition, the syntax tests are split out into a separate "npm run
test-syntax" script that runs using Mocha at the command-line. The reason
for this is because the onigurama package used by those tests is
native-compiled, and the compiled binary does not necessarily like running
in VS Code 32-bit on Windows. Ultimately, the syntax tests will be moving
into their own repo, so this is just a temporary measure.
  • Loading branch information
DustinCampbell committed Dec 19, 2016
1 parent 81f3869 commit 218d021
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 5 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@ node_js:
- "6"

env:
- CXX=g++-4.8
- CXX=g++-4.9

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- g++-4.9

install:
- npm install
- npm run vscode:prepublish
- npm run compile
- npm install -g vsce
- vsce package

script:
- npm test --silent
- npm run test-syntax

deploy:
provider: releases
api_key:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"vscode:prepublish": "tsc -p ./",
"compile": "tsc -p ./ && gulp tslint",
"watch": "tsc -watch -p ./",
"test": "mocha --timeout 15000 -u tdd ./out/test/*.test.js ./out/test/**/*.test.js",
"test": "node ./node_modules/vscode/bin/test",
"test-syntax": "mocha --timeout 15000 --ui bdd ./out/test/syntaxes/*.test.syntax.js",
"postinstall": "node ./node_modules/vscode/bin/install"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { should } from 'chai';
import { buildPromiseChain } from '../src/common';

suite("Common", () => {
before(() => should);
suiteSetup(() => should());

test("buildPromiseChain produces a sequence of promises", () => {
let array: number[] = [];
Expand Down
2 changes: 1 addition & 1 deletion test/platform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { should } from 'chai';
import { LinuxDistribution, PlatformInformation } from '../src/platform';

suite("Platform", () => {
before(() => should());
suiteSetup(() => should());

test("Retrieve correct information for Ubuntu 14.04", () => {
const dist = distro_ubuntu_14_04();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 218d021

Please sign in to comment.