TypeScript/tests/baselines/reference/importAssertion2(module=commonjs).js
Wenlu Wang ec114b8931
Import assertion (#40698)
* Add parsing

* fix all api

* check gramma of import call

* Add more part of assertion

* Add some case

* Add baseline

* use module insted of target

* strip assertion in d.ts

* Update new baseline

* accept baseline

* Revert error number changes

* Update diagnostic message

* Accept baseline

* rename path

* Fix cr issues

* Accept baseline

* Accept baseline

* Error if assertion and typeonly import

* Accept baseline

* Make lint happy

* Add some comment

* Fix cr issues

* Fix more issue

* Incorporate PR feedback, fix module resolution for import()

* Add contextual type and completions for ImportCall options argument

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-09-20 14:15:22 -07:00

66 lines
2.4 KiB
TypeScript

//// [tests/cases/conformance/importAssertion/importAssertion2.ts] ////
//// [0.ts]
export const a = 1;
export const b = 2;
//// [1.ts]
export {} from './0' assert { type: "json" }
export { a, b } from './0' assert { type: "json" }
export * from './0' assert { type: "json" }
export * as ns from './0' assert { type: "json" }
//// [2.ts]
export { a, b } from './0' assert {}
export { a as c, b as d } from './0' assert { a: "a", b: "b", c: "c" }
//// [0.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.b = exports.a = void 0;
exports.a = 1;
exports.b = 2;
//// [1.js]
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ns = exports.b = exports.a = void 0;
var _0_1 = require("./0");
Object.defineProperty(exports, "a", { enumerable: true, get: function () { return _0_1.a; } });
Object.defineProperty(exports, "b", { enumerable: true, get: function () { return _0_1.b; } });
__exportStar(require("./0"), exports);
exports.ns = require("./0");
//// [2.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.d = exports.c = exports.b = exports.a = void 0;
var _0_1 = require("./0");
Object.defineProperty(exports, "a", { enumerable: true, get: function () { return _0_1.a; } });
Object.defineProperty(exports, "b", { enumerable: true, get: function () { return _0_1.b; } });
var _0_2 = require("./0");
Object.defineProperty(exports, "c", { enumerable: true, get: function () { return _0_2.a; } });
Object.defineProperty(exports, "d", { enumerable: true, get: function () { return _0_2.b; } });
//// [0.d.ts]
export declare const a = 1;
export declare const b = 2;
//// [1.d.ts]
export {} from './0';
export { a, b } from './0';
export * from './0';
export * as ns from './0';
//// [2.d.ts]
export { a, b } from './0';
export { a as c, b as d } from './0';