Skip to content

Commit 178de24

Browse files
committed
fix(codegen): workaround server protocol tests
1 parent 17599ef commit 178de24

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

scripts/generate-clients/copy-to-clients.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,30 @@ const copyServerTests = async (sourceDir, destinationDir) => {
173173
directory: `private/${testName}`,
174174
},
175175
};
176+
if (!mergedManifest.scripts.test) {
177+
mergedManifest.scripts.test = "jest --coverage --passWithNoTests";
178+
}
176179
writeFileSync(destSubPath, JSON.stringify(mergedManifest, null, 2).concat(`\n`));
177180
} else if (overWritableSubs.includes(packageSub) || !existsSync(destSubPath)) {
178181
if (lstatSync(packageSubPath).isDirectory()) removeSync(destSubPath);
179182
copySync(packageSubPath, destSubPath, {
180183
overwrite: true,
181184
});
182185
}
186+
const jestConfigPath = join(destPath, "jest.config.js");
187+
writeFileSync(
188+
jestConfigPath,
189+
'const base = require("../../jest.config.base.js");\n' +
190+
"\n" +
191+
"module.exports = {\n" +
192+
" ...base,\n" +
193+
" globals: {\n" +
194+
" 'ts-jest': {\n" +
195+
" isolatedModules: true\n" +
196+
" }\n" +
197+
" }\n" +
198+
"};\n"
199+
);
183200
}
184201
}
185202
};

0 commit comments

Comments
 (0)