Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Tests a la Gulp #11

Merged
merged 1 commit into from
Nov 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
out
node_modules
node_modules
typings
24 changes: 23 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
var gulp = require('gulp');
var tslint = require('gulp-tslint');
var shell = require('gulp-shell');
var mocha = require('gulp-mocha');

var paths = {
scripts_ts: "src/**/*.ts",
tests_js: [
// test with dependencies on 'vscode' do not run
"out/test/extension.test.js",
"out/test/lexer.test.js",
"out/test/scanner.test.js"
]
};

gulp.task('tslint', function() {
Expand All @@ -13,4 +21,18 @@ gulp.task('tslint', function() {
}));
});

gulp.task('default', ['tslint']);
gulp.task('compile', shell.task([
'node ./node_modules/vscode/bin/compile -p ./',
]));

gulp.task('test', ['compile'], function () {
return gulp.src(paths.tests_js, {
read: false
})
.pipe(mocha({
ui: 'tdd',
reporter: 'spec'
}));
});

gulp.task('default', ['tslint', 'test']);
130 changes: 89 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,97 @@
{
"name": "vim",
"description": "Vim emulation for VS Code",
"version": "0.0.1",
"publisher": "VSCodeVim",
"contributors": [
"guillermooo",
"jpoon"
],
"engines": {
"vscode": "0.10.x"
},
"categories": [
"Others"
],
"activationEvents": [
"*"
"name": "vim",
"description": "Vim emulation for VS Code",
"version": "0.0.1",
"publisher": "VSCodeVim",
"contributors": [
"guillermooo",
"jpoon"
],
"engines": {
"vscode": "0.10.x"
},
"categories": [
"Others"
],
"activationEvents": [
"*"
],
"main": "./out/extension",
"contributes": {
"commands": [
{
"command": "extension.showCmdLine",
"title": "Vim: Show Command Line"
}
],
"main": "./out/extension",
"contributes": {
"commands": [
{ "command": "extension.showCmdLine", "title": "Vim: Show Command Line" }
],
"keybindings": [
{ "key": "Escape", "command": "extension.vimMode_esc", "when": "editorTextFocus" },
{ "key": "Shift+;", "command": "extension.vimMode_semicolon", "when": "editorTextFocus" },
{ "key": "H", "command": "extension.vimMode_h", "when": "editorTextFocus" },
{ "key": "J", "command": "extension.vimMode_j", "when": "editorTextFocus" },
{ "key": "K", "command": "extension.vimMode_k", "when": "editorTextFocus" },
{ "key": "L", "command": "extension.vimMode_l", "when": "editorTextFocus" },

{ "key": "Ctrl+H", "command": "cursorLeft", "when": "editorTextFocus" },
{ "key": "Ctrl+J", "command": "cursorDown", "when": "editorTextFocus" },
{ "key": "Ctrl+K", "command": "cursorUp", "when": "editorTextFocus" },
{ "key": "Ctrl+L", "command": "cursorRight", "when": "editorTextFocus" },
{ "key": "Ctrl+Shift+.", "command": "extension.showCmdLine", "when": "editorTextFocus" }
]
},
"scripts": {
"vscode:prepublish": "node ./node_modules/vscode/bin/compile",
"compile": "node ./node_modules/vscode/bin/compile -watch -p ./"
},
"keybindings": [
{
"key": "Escape",
"command": "extension.vimMode_esc",
"when": "editorTextFocus"
},
{
"key": "Shift+;",
"command": "extension.vimMode_semicolon",
"when": "editorTextFocus"
},
{
"key": "H",
"command": "extension.vimMode_h",
"when": "editorTextFocus"
},
{
"key": "J",
"command": "extension.vimMode_j",
"when": "editorTextFocus"
},
{
"key": "K",
"command": "extension.vimMode_k",
"when": "editorTextFocus"
},
{
"key": "L",
"command": "extension.vimMode_l",
"when": "editorTextFocus"
},
{
"key": "Ctrl+H",
"command": "cursorLeft",
"when": "editorTextFocus"
},
{
"key": "Ctrl+J",
"command": "cursorDown",
"when": "editorTextFocus"
},
{
"key": "Ctrl+K",
"command": "cursorUp",
"when": "editorTextFocus"
},
{
"key": "Ctrl+L",
"command": "cursorRight",
"when": "editorTextFocus"
},
{
"key": "Ctrl+Shift+.",
"command": "extension.showCmdLine",
"when": "editorTextFocus"
}
]
},
"scripts": {
"vscode:prepublish": "node ./node_modules/vscode/bin/compile",
"compile": "node ./node_modules/vscode/bin/compile -watch -p ./"
},
"devDependencies": {
"gulp": "^3.9.0",
"gulp-mocha": "^2.2.0",
"gulp-shell": "^0.5.1",
"gulp-tslint": "^3.6.0",
"gulp-typescript": "^2.9.2",
"typescript": "^1.6.2",
"vscode": "0.10.x"
}
}
15 changes: 0 additions & 15 deletions test/extension.test.ts

This file was deleted.

2 changes: 0 additions & 2 deletions test/lexer.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// The module 'assert' provides assertion methods from node
import * as assert from 'assert';

import * as vscode from 'vscode';
import * as lexer from '../src/cmd_line/lexer'
import {Token, TokenType} from '../src/cmd_line/token'

Expand Down
3 changes: 0 additions & 3 deletions test/parser.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// The module 'assert' provides assertion methods from node
import * as assert from 'assert';

import * as vscode from 'vscode';
import * as myExtension from '../extension';
import * as parser from '../src/cmd_line/parser';
import * as node from '../src/cmd_line/node';
Expand Down
5 changes: 0 additions & 5 deletions test/scanner.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// The module 'assert' provides assertion methods from node
import * as assert from 'assert';

// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import * as vscode from 'vscode';
import * as myExtension from '../extension';
import * as lexerState from '../src/cmd_line/scanner'

Expand Down