mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
chore: drop gulp test runner code (#7879)
This commit is contained in:
parent
b05d0936dd
commit
b8239d0d72
106
gulpfile.ts
106
gulpfile.ts
@ -9,14 +9,8 @@ const del = require("del");
|
||||
const shell = require("gulp-shell");
|
||||
const replace = require("gulp-replace");
|
||||
const rename = require("gulp-rename");
|
||||
const mocha = require("gulp-mocha");
|
||||
const chai = require("chai");
|
||||
const eslint = require("gulp-eslint");
|
||||
const sourcemaps = require("gulp-sourcemaps");
|
||||
const istanbul = require("gulp-istanbul");
|
||||
const remapIstanbul = require("remap-istanbul/lib/gulpRemapIstanbul");
|
||||
const ts = require("gulp-typescript");
|
||||
const args = require("yargs").argv;
|
||||
|
||||
@Gulpclass()
|
||||
export class Gulpfile {
|
||||
@ -252,104 +246,4 @@ export class Gulpfile {
|
||||
return ["package", "packagePublishNext"];
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Run tests tasks
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Runs ts linting to validate source code.
|
||||
*/
|
||||
@Task()
|
||||
eslint() {
|
||||
return gulp.src(["./src/**/*.ts", "./test/**/*.ts", "./sample/**/*.ts"])
|
||||
.pipe(eslint())
|
||||
.pipe(eslint.format('stylish'))
|
||||
.pipe(eslint.failAfterError())
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs before test coverage, required step to perform a test coverage.
|
||||
*/
|
||||
@Task()
|
||||
coveragePre() {
|
||||
return gulp.src(["./build/compiled/src/**/*.js"])
|
||||
.pipe(istanbul())
|
||||
.pipe(istanbul.hookRequire());
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs post coverage operations.
|
||||
*/
|
||||
@Task()
|
||||
coveragePost() {
|
||||
return gulp.src(["./build/compiled/test/**/*.js"])
|
||||
.pipe(istanbul.writeReports());
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs mocha tests.
|
||||
*/
|
||||
@Task()
|
||||
runTests() {
|
||||
chai.should();
|
||||
chai.use(require("sinon-chai"));
|
||||
chai.use(require("chai-as-promised"));
|
||||
|
||||
return gulp.src(["./build/compiled/test/**/*.js"])
|
||||
.pipe(mocha({
|
||||
bail: true,
|
||||
grep: !!args.grep ? new RegExp(args.grep) : undefined,
|
||||
timeout: 15000
|
||||
}));
|
||||
}
|
||||
|
||||
@Task()
|
||||
coverageRemap() {
|
||||
return gulp.src("./coverage/coverage-final.json")
|
||||
.pipe(remapIstanbul())
|
||||
.pipe(gulp.dest("./coverage"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles the code and runs tests + makes coverage report.
|
||||
*/
|
||||
@SequenceTask()
|
||||
tests() {
|
||||
return [
|
||||
"compile",
|
||||
"coveragePre",
|
||||
"runTests",
|
||||
"coveragePost",
|
||||
"coverageRemap"
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs tests, but creates a small delay before running them to make sure to give time for docker containers to be initialized.
|
||||
*/
|
||||
@SequenceTask("ci-tests")
|
||||
ciTests() {
|
||||
return [
|
||||
"clean",
|
||||
"compile",
|
||||
"tslint",
|
||||
"wait",
|
||||
"coveragePre",
|
||||
"runTests",
|
||||
"coveragePost",
|
||||
"coverageRemap"
|
||||
];
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// CI tasks
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@Task()
|
||||
createTravisOrmConfig() {
|
||||
return gulp.src("./ormconfig.travis.json")
|
||||
.pipe(rename("ormconfig.json"))
|
||||
.pipe(gulp.dest("./"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -212,7 +212,6 @@
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"test-ci": "gulp ci-tests",
|
||||
"test": "rimraf ./build && tsc && mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 60000 ./build/compiled/test",
|
||||
"test-fast": "mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 60000 ./build/compiled/test",
|
||||
"compile": "rimraf ./build && tsc",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user