Merge pull request #2468 from 0xProject/feat/fix-test-publish

Bump maxBuffer?
This commit is contained in:
Francesco Agosti
2020-02-03 19:59:03 -08:00
committed by GitHub
2 changed files with 7 additions and 4 deletions

View File

@@ -46,6 +46,9 @@ function logIfDefined(x: any): void {
}
}
// tslint:disable-next-line:custom-no-magic-numbers
const FIVE_MB = 1024 * 1024 * 5;
(async () => {
const IS_LOCAL_PUBLISH = process.env.IS_LOCAL_PUBLISH === 'true';
const registry = IS_LOCAL_PUBLISH ? 'http://localhost:4873/' : 'https://registry.npmjs.org/';
@@ -125,6 +128,7 @@ async function testInstallPackageAsync(
utils.log(`Installing ${packageName}@${lastChangelogVersion}`);
await execAsync(`npm install --save ${packageName}@${lastChangelogVersion} --registry=${registry}`, {
cwd: testDirectory,
maxBuffer: FIVE_MB,
});
const indexFilePath = path.join(testDirectory, 'index.ts');
await writeFileAsync(indexFilePath, `import * as Package from '${packageName}';\nconsole.log(Package);\n`);
@@ -152,9 +156,7 @@ async function testInstallPackageAsync(
if (!isUnrunnablePkg) {
const transpiledIndexFilePath = path.join(testDirectory, 'index.js');
utils.log(`Running test script with ${packageName} imported`);
// tslint:disable-next-line:custom-no-magic-numbers
const fiveMb = 1024 * 1024 * 5;
await execAsync(`node ${transpiledIndexFilePath}`, { maxBuffer: fiveMb });
await execAsync(`node ${transpiledIndexFilePath}`, { maxBuffer: FIVE_MB });
utils.log(`Successfully ran test script with ${packageName} imported`);
}
await rimrafAsync(testDirectory);

View File

@@ -25,7 +25,8 @@
"diff_docs": "git diff --exit-code ./docs",
"s3:sync_md_docs": "aws s3 sync ./docs s3://docs-markdown/${npm_package_name}/v${npm_package_version} --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
"docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json",
"docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
"docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES",
"postinstall": "node -e \"try{ fs.unlinkSync(path.resolve(path.dirname(require.resolve('ganache-core')), './typings/index.d.ts')) } catch (err) {}\""
},
"config": {
"postpublish": {