mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-13 03:35:52 +01:00
chore: flaky test local storage (#4497)
* chore: flaky test local storage * fix test
This commit is contained in:
parent
6bae1c0739
commit
50eb7b2ca4
@ -4,7 +4,7 @@ module.exports = {
|
|||||||
'^.+\\.(js|ts)$': 'babel-jest',
|
'^.+\\.(js|ts)$': 'babel-jest',
|
||||||
},
|
},
|
||||||
verbose: false,
|
verbose: false,
|
||||||
collectCoverage: true,
|
collectCoverage: false,
|
||||||
coverageReporters: ['text', 'html'],
|
coverageReporters: ['text', 'html'],
|
||||||
collectCoverageFrom: ['src/**/*.ts', '!**/node_modules/**', '!**/partials/**', '!**/fixture/**'],
|
collectCoverageFrom: ['src/**/*.ts', '!**/node_modules/**', '!**/partials/**', '!**/fixture/**'],
|
||||||
coveragePathIgnorePatterns: ['node_modules', 'fixtures'],
|
coveragePathIgnorePatterns: ['node_modules', 'fixtures'],
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rimraf ./build",
|
"clean": "rimraf ./build",
|
||||||
"test": "jest",
|
"test": "jest --runInBand",
|
||||||
"type-check": "tsc --noEmit -p tsconfig.build.json",
|
"type-check": "tsc --noEmit -p tsconfig.build.json",
|
||||||
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
|
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
|
||||||
"build:js": "babel src/ --out-dir build/ --copy-files --extensions \".ts,.tsx\" --source-maps",
|
"build:js": "babel src/ --out-dir build/ --copy-files --extensions \".ts,.tsx\" --source-maps",
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -100,7 +100,7 @@ describe('Local FS test', () => {
|
|||||||
path.join(__dirname, '__fixtures__/readme-test-next'),
|
path.join(__dirname, '__fixtures__/readme-test-next'),
|
||||||
logger
|
logger
|
||||||
);
|
);
|
||||||
localFs.readTarball('test-readme-0.0.0.tgz', { signal: abort.signal }).then((stream) => {
|
localFs.readTarball('test-readme-0.0.1.tgz', { signal: abort.signal }).then((stream) => {
|
||||||
stream.on('data', (data) => {
|
stream.on('data', (data) => {
|
||||||
expect(data.length).toEqual(352);
|
expect(data.length).toEqual(352);
|
||||||
});
|
});
|
||||||
@ -116,7 +116,7 @@ describe('Local FS test', () => {
|
|||||||
path.join(__dirname, '__fixtures__/readme-test-next'),
|
path.join(__dirname, '__fixtures__/readme-test-next'),
|
||||||
logger
|
logger
|
||||||
);
|
);
|
||||||
localFs.readTarball('test-readme-0.0.0.tgz', { signal: abort.signal }).then((stream) => {
|
localFs.readTarball('test-readme-0.0.3.tgz', { signal: abort.signal }).then((stream) => {
|
||||||
stream.on('error', (error: any) => {
|
stream.on('error', (error: any) => {
|
||||||
// FIXME: might be different results sometimes, need research
|
// FIXME: might be different results sometimes, need research
|
||||||
// expect(error.code).toEqual('ABORT_ERR');
|
// expect(error.code).toEqual('ABORT_ERR');
|
||||||
@ -148,11 +148,11 @@ describe('Local FS test', () => {
|
|||||||
logger
|
logger
|
||||||
);
|
);
|
||||||
const abort = new AbortController();
|
const abort = new AbortController();
|
||||||
|
|
||||||
localFs.readTarball('test-readme-0.0.0.tgz', { signal: abort.signal }).then((stream) => {
|
localFs.readTarball('test-readme-0.0.0.tgz', { signal: abort.signal }).then((stream) => {
|
||||||
stream.on('data', (data) => {
|
stream.on('data', (data) => {
|
||||||
expect(data.length).toEqual(352);
|
expect(data.length).toEqual(352);
|
||||||
});
|
});
|
||||||
|
|
||||||
stream.on('content-length', (content) => {
|
stream.on('content-length', (content) => {
|
||||||
expect(content).toEqual(352);
|
expect(content).toEqual(352);
|
||||||
done();
|
done();
|
||||||
|
@ -875,7 +875,7 @@ describe('storage', () => {
|
|||||||
storage: generateRandomStorage(),
|
storage: generateRandomStorage(),
|
||||||
uplinks: {
|
uplinks: {
|
||||||
npmjs: {
|
npmjs: {
|
||||||
url: 'https://registry.npmjs.org',
|
url: 'https://registry.domain.com',
|
||||||
timeout: '2s',
|
timeout: '2s',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user