mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-11 09:24:19 -06:00
Actually capture oldTranspile baselines (#18584)
This commit is contained in:
parent
8f4a2c184c
commit
ab6bb1618f
@ -17,32 +17,33 @@ namespace ts {
|
||||
let oldTranspileResult: string;
|
||||
let oldTranspileDiagnostics: Diagnostic[];
|
||||
|
||||
transpileOptions = testSettings.options || {};
|
||||
if (!transpileOptions.compilerOptions) {
|
||||
transpileOptions.compilerOptions = {};
|
||||
}
|
||||
|
||||
if (transpileOptions.compilerOptions.newLine === undefined) {
|
||||
// use \r\n as default new line
|
||||
transpileOptions.compilerOptions.newLine = ts.NewLineKind.CarriageReturnLineFeed;
|
||||
}
|
||||
|
||||
transpileOptions.compilerOptions.sourceMap = true;
|
||||
|
||||
if (!transpileOptions.fileName) {
|
||||
transpileOptions.fileName = transpileOptions.compilerOptions.jsx ? "file.tsx" : "file.ts";
|
||||
}
|
||||
|
||||
transpileOptions.reportDiagnostics = true;
|
||||
|
||||
justName = "transpile/" + name.replace(/[^a-z0-9\-. ]/ig, "") + (transpileOptions.compilerOptions.jsx ? Extension.Tsx : Extension.Ts);
|
||||
toBeCompiled = [{
|
||||
unitName: transpileOptions.fileName,
|
||||
content: input
|
||||
}];
|
||||
|
||||
canUseOldTranspile = !transpileOptions.renamedDependencies;
|
||||
|
||||
before(() => {
|
||||
transpileOptions = testSettings.options || {};
|
||||
if (!transpileOptions.compilerOptions) {
|
||||
transpileOptions.compilerOptions = {};
|
||||
}
|
||||
|
||||
if (transpileOptions.compilerOptions.newLine === undefined) {
|
||||
// use \r\n as default new line
|
||||
transpileOptions.compilerOptions.newLine = ts.NewLineKind.CarriageReturnLineFeed;
|
||||
}
|
||||
|
||||
transpileOptions.compilerOptions.sourceMap = true;
|
||||
|
||||
if (!transpileOptions.fileName) {
|
||||
transpileOptions.fileName = transpileOptions.compilerOptions.jsx ? "file.tsx" : "file.ts";
|
||||
}
|
||||
|
||||
transpileOptions.reportDiagnostics = true;
|
||||
|
||||
justName = "transpile/" + name.replace(/[^a-z0-9\-. ]/ig, "") + (transpileOptions.compilerOptions.jsx ? Extension.Tsx : Extension.Ts);
|
||||
toBeCompiled = [{
|
||||
unitName: transpileOptions.fileName,
|
||||
content: input
|
||||
}];
|
||||
|
||||
canUseOldTranspile = !transpileOptions.renamedDependencies;
|
||||
transpileResult = transpileModule(input, transpileOptions);
|
||||
|
||||
if (canUseOldTranspile) {
|
||||
@ -52,10 +53,6 @@ namespace ts {
|
||||
});
|
||||
|
||||
after(() => {
|
||||
justName = undefined;
|
||||
transpileOptions = undefined;
|
||||
canUseOldTranspile = undefined;
|
||||
toBeCompiled = undefined;
|
||||
transpileResult = undefined;
|
||||
oldTranspileResult = undefined;
|
||||
oldTranspileDiagnostics = undefined;
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
export const x = 0;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var ng = require("angular2/core");
|
||||
var MyClass1 = /** @class */ (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
fooexport,
|
||||
__metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,35 @@
|
||||
System.register(["angular2/core"], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var ng, MyClass1;
|
||||
return {
|
||||
setters: [
|
||||
function (ng_1) {
|
||||
ng = ng_1;
|
||||
}
|
||||
],
|
||||
execute: function () {
|
||||
MyClass1 = /** @class */ (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
fooexport,
|
||||
__metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
}
|
||||
};
|
||||
});
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
var x = 0;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,7 @@
|
||||
file.ts(1,3): error TS1005: ';' expected.
|
||||
|
||||
|
||||
==== file.ts (1 errors) ====
|
||||
a b
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
@ -0,0 +1,3 @@
|
||||
a;
|
||||
b;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,5 @@
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
var x = 0;
|
||||
});
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
/// <reference path="file2.ts" />
|
||||
var x = 0;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
var x = 0;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
var x = 0;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,6 @@
|
||||
error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'esnext'.
|
||||
|
||||
|
||||
!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'esnext'.
|
||||
==== file.ts (0 errors) ====
|
||||
|
||||
@ -0,0 +1 @@
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,6 @@
|
||||
error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'esnext'.
|
||||
|
||||
|
||||
!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'esnext'.
|
||||
==== file.ts (0 errors) ====
|
||||
|
||||
@ -0,0 +1 @@
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,11 @@
|
||||
System.register("NamedModule", [], function (exports_1, context_1) {
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var x;
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
x = 1;
|
||||
}
|
||||
};
|
||||
});
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
var a = 10;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
var a = 10;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
var x;
|
||||
//# sourceMappingURL=b.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
var x;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var db_1 = require("./db");
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
var MyClass = /** @class */ (function () {
|
||||
function MyClass(db) {
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof db_1.db !== "undefined" && db_1.db) === "function" && _a || Object])
|
||||
], MyClass);
|
||||
return MyClass;
|
||||
var _a;
|
||||
}());
|
||||
exports.MyClass = MyClass;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
var x = 0;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
var a = 10;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
var x = React.createElement("div", null);
|
||||
//# sourceMappingURL=file.js.map
|
||||
Loading…
x
Reference in New Issue
Block a user