diff --git a/spec/vast_parser.spec.js b/spec/vast_parser.spec.js index 9fc02714..0cf3379d 100644 --- a/spec/vast_parser.spec.js +++ b/spec/vast_parser.spec.js @@ -661,6 +661,9 @@ describe('VASTParser', () => { url: wrapperBVastUrl, maxWrapperDepth: VastParser.maxWrapperDepth, emitter: expect.any(Function), + wrapperDepth: 1, + previousUrl: wrapperAVastUrl, + wrapperAd: expect.any(Object), }); expect(VastParser.parse).toHaveBeenCalledWith(expect.any(Object), { url: wrapperBVastUrl, @@ -690,6 +693,9 @@ describe('VASTParser', () => { url: wrapperBVastUrl, maxWrapperDepth: VastParser.maxWrapperDepth, emitter: expect.any(Function), + wrapperDepth: 1, + previousUrl: wrapperAVastUrl, + wrapperAd: expect.any(Object), }); expect(VastParser.parse).not.toHaveBeenCalled(); expect(parserUtils.mergeWrapperAdData).not.toBeCalled(); diff --git a/src/parser/vast_parser.js b/src/parser/vast_parser.js index 724ebe68..19c61952 100644 --- a/src/parser/vast_parser.js +++ b/src/parser/vast_parser.js @@ -398,6 +398,9 @@ export class VASTParser extends EventEmitter { url: ad.nextWrapperURL, emitter: this.emit.bind(this), maxWrapperDepth: this.maxWrapperDepth, + wrapperDepth, + previousUrl, + wrapperAd: ad, }) .then((xml) => { return this.parse(xml, {