MCPcopy Create free account
hub / github.com/nodejs/node / testSuper

Function testSuper

deps/v8/tools/clusterfuzz/js_fuzzer/test/test_regressions.js:167–184  ·  view source on GitHub ↗
(settings, db_path, expected)

Source from the content-addressed store, hash-verified

165 });
166
167 function testSuper(settings, db_path, expected) {
168 // Enforce mutations at every possible location.
169 settings['MUTATE_CROSSOVER_INSERT'] = 1.0;
170 // Choose the only-super-statments path. This also fixed the insertion
171 // order to only insert before a statement.
172 sandbox.stub(random, 'choose').callsFake(() => { return true; });
173
174 const fakeDb = new db.MutateDb(db_path);
175 const mutator = new crossOver.CrossOverMutator(settings, fakeDb);
176
177 // An input with a couple of insertion spots in constructors and
178 // methods of two classes. One root and one a subclass.
179 const source = helpers.loadTestData('regress/super/input.js');
180 mutator.mutate(source);
181
182 const mutated = sourceHelpers.generateCode(source);
183 helpers.assertExpectedResult(expected, mutated);
184 }
185
186 it('mutates super call', () => {
187 // Ensure that a super() call expression isn't added to a

Callers 1

Calls 1

mutateMethod · 0.45

Tested by

no test coverage detected