Skip to content

Commit 767ca64

Browse files
committed
chore: restore fuzz test
1 parent d9e0154 commit 767ca64

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/processors/testCheckRepoInAuthList.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const chai = require('chai');
22
const sinon = require('sinon');
3+
const fc = require('fast-check');
34
const actions = require('../../src/proxy/actions/Action');
45
const processor = require('../../src/proxy/processors/push-action/checkRepoInAuthorisedList');
56
const expect = chai.expect;
@@ -35,4 +36,17 @@ describe('Check a Repo is in the authorised list', async () => {
3536
'checkRepoInAuthorisedList - repo thisproject/repo-is-not-ok is not in the authorised whitelist, ending',
3637
);
3738
});
39+
40+
describe('fuzzing', () => {
41+
it('should not crash on random repo names', async () => {
42+
await fc.assert(
43+
fc.asyncProperty(fc.string(), async (repoName) => {
44+
const action = new actions.Action('123', 'type', 'get', 1234, repoName);
45+
const result = await processor.exec(null, action);
46+
expect(result.error).to.be.true;
47+
}),
48+
{ numRuns: 1000 },
49+
);
50+
});
51+
});
3852
});

0 commit comments

Comments
 (0)