Skip to content

Commit 6da6875

Browse files
committed
chore: fix jest for sub projects
1 parent 4728a14 commit 6da6875

File tree

5 files changed

+101
-3
lines changed

5 files changed

+101
-3
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`rollup build: outputs 1`] = `
4+
Object {
5+
"cjs": Array [
6+
Object {
7+
"code": "'use strict';
8+
9+
Object.defineProperty(exports, '__esModule', { value: true });
10+
11+
var path = require('path');
12+
13+
function _interopNamespace(e) {
14+
if (e && e.__esModule) return e;
15+
var n = Object.create(null);
16+
if (e) {
17+
Object.keys(e).forEach(function (k) {
18+
if (k !== 'default') {
19+
var d = Object.getOwnPropertyDescriptor(e, k);
20+
Object.defineProperty(n, k, d.get ? d : {
21+
enumerable: true,
22+
get: function () { return e[k]; }
23+
});
24+
}
25+
});
26+
}
27+
n[\\"default\\"] = e;
28+
return Object.freeze(n);
29+
}
30+
31+
var path__namespace = /*#__PURE__*/_interopNamespace(path);
32+
33+
/**
34+
* This module is only for testing
35+
*/
36+
const MESSAGE = \\"This module is only for testing\\";
37+
function hello(name = \\"world\\") {
38+
return \\"Hello \\".concat(name, \\"!\\");
39+
}
40+
function testPathDelimiter() {
41+
return path__namespace.delimiter;
42+
}
43+
44+
var testMod = /*#__PURE__*/Object.freeze({
45+
__proto__: null,
46+
MESSAGE: MESSAGE,
47+
hello: hello,
48+
testPathDelimiter: testPathDelimiter
49+
});
50+
51+
exports.testMod = testMod;
52+
",
53+
"fileName": "index.js",
54+
"name": "index",
55+
"type": "chunk",
56+
},
57+
],
58+
"esm": Array [
59+
Object {
60+
"code": "import * as path from 'path';
61+
62+
/**
63+
* This module is only for testing
64+
*/
65+
const MESSAGE = \\"This module is only for testing\\";
66+
function hello(name = \\"world\\") {
67+
return \\"Hello \\".concat(name, \\"!\\");
68+
}
69+
function testPathDelimiter() {
70+
return path.delimiter;
71+
}
72+
73+
var testMod = /*#__PURE__*/Object.freeze({
74+
__proto__: null,
75+
MESSAGE: MESSAGE,
76+
hello: hello,
77+
testPathDelimiter: testPathDelimiter
78+
});
79+
80+
export { testMod };
81+
",
82+
"fileName": "index.js",
83+
"name": "index",
84+
"type": "chunk",
85+
},
86+
],
87+
}
88+
`;
89+
90+
exports[`rollup build: watchFiles 1`] = `
91+
Array [
92+
"index.mjs",
93+
"../../dist/es/util/test-mod.js",
94+
]
95+
`;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("tlibjs-dist/ts-jest");

test-projects/rollup-import/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"devDependencies": {
77
"@rollup/plugin-node-resolve": "^13.0.6",
88
"core-js": "^3.19.0",
9-
"rollup": "^2.58.3"
9+
"rollup": "^2.58.3",
10+
"ts-jest": "^27.0.7"
1011
}
1112
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { posix as pp } from "path";
33
import { rollup } from "rollup";
44
import nodeResolve from "@rollup/plugin-node-resolve";
55

6-
const FORMATS = ["esm", "cjs"];
6+
const FORMATS = ["esm", "cjs"] as const;
77

88
test("rollup build", async () => {
99
const bundle = await rollup({

yarn.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8407,6 +8407,7 @@ __metadata:
84078407
core-js: ^3.19.0
84088408
rollup: ^2.58.3
84098409
tlibjs-dist: "link:../../dist"
8410+
ts-jest: ^27.0.7
84108411
languageName: unknown
84118412
linkType: soft
84128413

@@ -9347,7 +9348,7 @@ __metadata:
93479348
languageName: node
93489349
linkType: hard
93499350

9350-
"ts-jest@npm:^27.0.3":
9351+
"ts-jest@npm:^27.0.3, ts-jest@npm:^27.0.7":
93519352
version: 27.0.7
93529353
resolution: "ts-jest@npm:27.0.7"
93539354
dependencies:

0 commit comments

Comments
 (0)