forked from adamwong246/testeranto
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtesteranto.mts
112 lines (106 loc) · 3.36 KB
/
testeranto.mts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import { IBaseConfig } from "testeranto/src/lib/types.js";
import { solidityEsBuildConfig } from "./subPackages/solidity/index.js";
const config: IBaseConfig = {
outdir: "docs",
tests: [
// Don't use these tests.
// Testing react components with the react package is not useful
// Use react-dom or react-test-renderer instead for testing components
// these test might be useful if you are testing react itself, rather than a react component
// ["./src/LoginPage/react/web.test.tsx", "web", { ports: 0 }, []],
// ["./src/LoginPage/react/node.test.tsx", "node", { ports: 0 }, []],
[
"./src/LoginPage/react-test-renderer/web.test.tsx",
"web",
{ ports: 0 },
[],
],
["./src/Rectangle/Rectangle.test.electron.ts", "web", { ports: 0 }, []],
// [
// "./src/ClassicalComponent/react-dom/client.web.test.tsx",
// "web",
// { ports: 0 },
// [],
// ],
[
"./src/LoginPage/react-test-renderer/node.test.tsx",
"node",
{ ports: 0 },
[],
],
["./src/ReactStateAndHook.test.tsx", "node", { ports: 0 }, []],
["./src/app.reduxToolkit.test.ts", "node", { ports: 0 }, []],
["./src/app.redux.test.ts", "node", { ports: 0 }, []],
[
"./src/Rectangle/Rectangle.test.node.ts",
"node",
{ ports: 0 },
[["./src/ClassicalComponent/test.ts", "web", { ports: 0 }, []]],
],
["./src/MyFirstContract.basic.test.ts", "node", { ports: 0 }, []],
["./src/MyFirstContract.rpc.test.ts", "node", { ports: 1 }, []],
// [
// "./src/MyFirstContract.solidity-react.testeranto.ts",
// "node",
// { ports: 1 },
// [["./src/MyFirstContractUI.tsx", "web", { ports: 0 }, []]],
// ],
],
debugger: true,
clearScreen: false,
devMode: false,
minify: false,
outbase: ".",
externals: ["ganache", "stream"],
ports: ["3001", "3002", "3003", "3004", "3005", "3006", "3007"],
webPlugins: [solidityEsBuildConfig],
nodePlugins: [
{
name: "ganache-shim",
setup(build) {
build.onResolve({ filter: /.*/ }, (args) => {
// return ({
// path: "MyFirstContract",
// namespace: 'ganache-shim',
// })
});
// build.onLoad({ filter: /.*/, namespace: 'ganache-shim' }, async (argz) => {
// return ({
// contents: JSON.stringify((await solCompile(argz.path))),
// loader: 'json',
// watchDirs: [process.cwd() + "/contracts"]
// })
// })
},
},
solidityEsBuildConfig,
// {
// name: "solidity",
// setup(build) {
// build.onResolve({ filter: /^.*\.sol$/ }, (args) => {
// return {
// path: "MyFirstContract",
// namespace: "solidity",
// };
// });
// build.onLoad({ filter: /.*/, namespace: "solidity" }, async (argz) => {
// return {
// contents: JSON.stringify(await solCompile(argz.path)),
// loader: "json",
// watchDirs: [process.cwd() + "/contracts"],
// };
// });
// },
// },
],
featureIngestor: async function (s: string): Promise<string> {
return new Promise(async (res, rej) => {
try {
res((await (await fetch(new URL(s).href)).json()).body);
} catch (err) {
res(s);
}
});
},
};
export default config;