Skip to content

Commit

Permalink
chore: rearrange test suites
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Jul 4, 2020
1 parent ca11a5a commit 74622f5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,14 @@ Constructor('hijack', () => {
assert.equal(count, 0, '~> did not call constructor');
});

Constructor.run();

// ---

const Pollution = suite('pollution');

// @see https://snyk.io/vuln/SNYK-JS-LODASH-450202
Constructor('pollution', () => {
Pollution('constructor', () => {
const payload = '{"constructor":{"prototype":{"a0":true}}}';

const input = JSON.parse(payload);
Expand All @@ -115,14 +121,8 @@ Constructor('pollution', () => {
assert.notEqual(output['a0'], true, 'Safe output');
});

Constructor.run();

// ---

const Prototype = suite('prototype');

// @see https://snyk.io/vuln/SNYK-JS-LODASH-450202
Prototype('prototype :: pollution', () => {
Pollution('prototype', () => {
const payload = '{"__proto__":{"a0":true}}';
const input = JSON.parse(payload);
const output = klona(input);
Expand All @@ -138,7 +138,7 @@ Prototype('prototype :: pollution', () => {
assert.notEqual(output['a0'], true, 'Safe output');
});

Prototype.run();
Pollution.run();

// ---

Expand Down

0 comments on commit 74622f5

Please sign in to comment.