Skip to content

Commit

Permalink
Add task hooks for build and test
Browse files Browse the repository at this point in the history
  • Loading branch information
Codesleuth authored and EsendexDev committed Aug 27, 2015
1 parent 29375db commit a9c84dd
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
build/
build/
typings/
38 changes: 30 additions & 8 deletions .settings/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,42 @@
"version": "0.1.0",

// The command is tsc. Assumes that tsc has been installed using npm install -g typescript
"command": "tsc",
"command": "npm",

// The command is a shell script
"isShellCommand": true,

// Show the output window only if unrecognized errors occur.
"showOutput": "silent",

// args is the HelloWorld program to compile.
"args": [],

// use the standard tsc problem matcher to find compile problems
// in the output.
"problemMatcher": "$tsc"

"tasks": [
{
"taskName": "build",
// Build is not a default script and needs to be run.
"args": ["run"],
// Make this the default build command.
"isBuildCommand": true,
// use the standard tsc problem matcher to find compile problems
// in the output.
"problemMatcher": "$tsc"
},
{
"taskName": "test",
// Make this the default test command.
"isTestCommand": true,
// Show the output window only if unrecognized errors occur.
"showOutput": "silent",
// Match on Mocha problems.
"problemMatcher": {
"owner": "mocha",
"pattern": {
"regexp": "^\\s*(\\d+)\\)\\s*(.+)\\:$",
"file": 1,
"message": 2
}
}
}
]
}

// A task runner that calls the Typescript compiler (tsc) and
Expand Down
Empty file added custom_typings/tsd.d.ts
Empty file.
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Demonstrates a skeleton project for TypeScript development with Visual Studio Code.",
"main": "build/js/app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "cd src && tsc",
"test": "./node_modules/.bin/mocha build/test"
},
"repository": {
"type": "git",
Expand All @@ -27,5 +28,10 @@
"url": "https://github.com/codesleuth/vscode-typescript-example/issues"
},
"homepage": "https://github.com/codesleuth/vscode-typescript-example#readme",
"private": true
"private": true,
"devDependencies": {
"mocha": "^2.2.5",
"tsc": "^1.20150623.0",
"tsd": "^0.6.3"
}
}
2 changes: 2 additions & 0 deletions src/_ref.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference path="../typings/tsd.d.ts" />
/// <reference path="../custom_typings/tsd.d.ts" />
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions src/test/app.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// <reference path="../_ref.d.ts" />

import assert = require('assert')

describe('Some suite', () => {

describe('Some functionality', () => {

it('should really just pass', () => {
assert.ok(true)
})

})

})
3 changes: 2 additions & 1 deletion tsconfig.json → src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"target": "ES5",
"module": "commonjs",
"sourceMap": true,
"outDir": "build/js"
"outDir": "../build/",
"removeComments": true
}
}
15 changes: 15 additions & 0 deletions tsd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"mocha/mocha.d.ts": {
"commit": "e5de5c4daf8cdc33ed60704cd6e8021c99a89f92"
},
"node/node.d.ts": {
"commit": "e5de5c4daf8cdc33ed60704cd6e8021c99a89f92"
}
}
}

0 comments on commit a9c84dd

Please sign in to comment.