-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Update harness to use single robust virtual file system for tests. #20763
Changes from 24 commits
5b4553d
41aeaae
560cffd
db6794a
8ff9520
8a70e17
07bb677
7d08d74
8245f62
cf261c3
4697ba3
cd0809e
791c01e
646c32c
4fbc74e
3d3977f
41567b2
fa42835
c5e5020
c3701df
1cb1088
6727499
7944f50
279b348
b4c3bd4
e426257
d409155
ddb2155
ac51fa0
c87b725
6b53d38
dd054e6
17281d0
fb469e7
2646ee2
9c25443
ee41557
87de5ff
774ed0c
cda8728
7ca84ac
9e6cd16
f527a15
545868c
d0988b8
4d8d514
7f4ac29
97a842f
16cfcc4
bb05381
3de9630
e2bbc3e
4eb3b6b
0b96348
f153b04
1efb844
ea9f999
1cbe930
154f09b
8b86423
1658770
0322d71
6b79161
370107e
e422365
bb26ab5
c9c562a
8424c4d
4863d55
1dff0af
d62a11f
860f9f8
66c11c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
// Available variables which can be used inside of strings. | ||
// ${workspaceRoot}: the root folder of the team | ||
// ${file}: the current opened file | ||
// ${fileBasename}: the current opened file's basename | ||
// ${fileDirname}: the current opened file's dirname | ||
// ${fileExtname}: the current opened file's extension | ||
// ${cwd}: the current working directory of the spawned process | ||
{ | ||
"version": "0.1.0", | ||
"command": "gulp", | ||
"isShellCommand": true, | ||
"showOutput": "silent", | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"taskName": "local", | ||
"isBuildCommand": true, | ||
"showOutput": "silent", | ||
"problemMatcher": [ | ||
"$tsc" | ||
] | ||
"type": "shell", | ||
"identifier": "local", | ||
"label": "gulp: local", | ||
"command": "gulp", | ||
"args": ["local"], | ||
"group": { "kind": "build", "isDefault": true }, | ||
"problemMatcher": ["$gulp-tsc"] | ||
}, | ||
{ | ||
"taskName": "tests", | ||
"showOutput": "silent", | ||
"problemMatcher": [ | ||
"$tsc" | ||
] | ||
"type": "shell", | ||
"identifier": "tsc", | ||
"label": "gulp: tsc", | ||
"command": "gulp", | ||
"args": ["tsc"], | ||
"group": "build", | ||
"problemMatcher": ["$gulp-tsc"] | ||
}, | ||
{ | ||
"type": "shell", | ||
"identifier": "tests", | ||
"label": "gulp: tests", | ||
"command": "gulp", | ||
"args": ["tests"], | ||
"group": "build", | ||
"problemMatcher": ["$gulp-tsc"] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ | |
"@types/node": "latest", | ||
"@types/q": "latest", | ||
"@types/run-sequence": "latest", | ||
"@types/source-map-support": "^0.4.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is pinned while we generally use |
||
"@types/through2": "latest", | ||
"@types/xml2js": "^0.4.0", | ||
"xml2js": "^0.4.19", | ||
|
@@ -78,6 +79,7 @@ | |
"travis-fold": "latest", | ||
"ts-node": "latest", | ||
"tslint": "latest", | ||
"typemock": "file:scripts/typemock", | ||
"vinyl": "latest", | ||
"chalk": "latest", | ||
"typescript": "next" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const gulp = require("gulp"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth considering making this a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather not change the extension. TypeMock was originally a garage/hackathon project I put together a few years back and eventually I'd like to see about publishing it as a standalone package. Since the gulpfile is so simple I don't think its worth adding the ts-node dependency and overhead to support a .ts extension. |
||
const gutil = require("gulp-util"); | ||
const sourcemaps = require("gulp-sourcemaps"); | ||
const tsb = require("gulp-tsb"); | ||
const mocha = require("gulp-mocha"); | ||
const del = require("del"); | ||
|
||
const src = { | ||
compile: tsb.create("src/tsconfig.json"), | ||
src: () => gulp.src(["src/**/*.ts"]), | ||
dest: () => gulp.dest("dist") | ||
}; | ||
|
||
gulp.task("clean", () => del(["dist/**/*"])); | ||
|
||
gulp.task("build", () => src.src() | ||
.pipe(sourcemaps.init()) | ||
.pipe(src.compile()) | ||
.pipe(sourcemaps.write(".", { includeContent: false, destPath: "dist" })) | ||
.pipe(gulp.dest("dist"))); | ||
|
||
gulp.task("test", ["build"], () => gulp | ||
.src(["dist/tests/index.js"], { read: false }) | ||
.pipe(mocha({ reporter: "dot" }))); | ||
|
||
gulp.task("watch", () => gulp.watch(["src/**/*"], ["test"])); | ||
|
||
gulp.task("default", ["test"]); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"private": true, | ||
"name": "typemock", | ||
"version": "0.0.0", | ||
"description": "JavaScript Mock object framework", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"test": "gulp test" | ||
}, | ||
"keywords": [ | ||
"javascript", | ||
"mock", | ||
"type", | ||
"typescript" | ||
], | ||
"author": "Ron Buckton (ron.buckton@microsoft.com)", | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"@types/chai": "^4.0.4", | ||
"@types/mocha": "^2.2.27", | ||
"@types/node": "^8.0.20", | ||
"@types/source-map-support": "^0.4.0", | ||
"chai": "^4.1.2", | ||
"del": "^2.0.2", | ||
"gulp": "^3.9.1", | ||
"gulp-mocha": "^4.3.1", | ||
"gulp-sourcemaps": "^2.6.1", | ||
"gulp-tsb": "^2.0.5", | ||
"merge2": "^0.3.6", | ||
"mocha": "^2.2.5", | ||
"source-map-support": "^0.5.0", | ||
"typescript": "^2.6.1" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably add either a jake task that mirror this, or a jake task that shells out to this; otherwise the
jake tests
task will fail if you have yet to buildtypemock
, no? At least until we removejake
, which is something I, personally, would be happy to entertain again. The team has had, like, 2 years to adopt new habits. 🐱 Hmmm... if outright removing it is too much right now (just because muscle/task memory), then maybe swapping all the jakefile's tasks with ones that shellout togulp
would be appropriate... Gah, that's a topic for another issue. In any case, this typemock-building functionality should probably be accessible viajake
in some way.