UNPKG

vast-xml

Version:

VAST XML responses for online video advertisers.

33 lines (29 loc) 850 B
var test = require('tap').test , VAST = require('../index.js') , vast = new VAST(); test('Validate ad settings', function(t){ t.throws(function(){ vast.attachAd({ structure : 'wrapper' , AdSystem : 'Common name of the ad' , sequence : 23 }); }, 'It should throw an error if no VASTAdTagURI is set'); t.throws(function(){ vast.attachAd({ structure : 'wrapper' , sequence : 23 , Error : '' , VASTAdTagURI : 'http://example.com' }); }, 'It should throw an error if no AdSystem is set'); t.end(); }); vast.attachAd({ structure : 'wrapper' , AdSystem : 'Common name of the ad' , sequence : 23 , Error: 'http://error.err' , VASTAdTagURI : 'http://example.com' }).attachImpression({ id: Date.now(), url : 'http://impression.com' }); module.exports = vast;