Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the integration test for 3P ad networks. #4260

Merged
merged 1 commit into from Aug 1, 2016

Conversation

lannka
Copy link
Contributor

@lannka lannka commented Jul 28, 2016

Right now the test-integration.js is not that helpful regarding to catching an unregistered ad networks. (Because if they didn't register, for sure they'll not update the test as well.)

Improved the test by doing:

  • Test runner scans the /ads/ dir for all the 3p JS files, then passed to Mocha tests via env variable.
  • Allow naming exceptions.

This work is part of #4190

expect(registrations).to.include.key('adition');
expect(registrations).to.include.key('adform');
// Get all ad extensions from test env.
const extensions = window.ampTestRuntimeConfig.adExtensions;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im honestly slightly conflicted with this, as much as its a nicety i'd rather keep tests as stupid simple as possible even with the repetition.

but yeah, this more positive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case is to catch any unregistered ad networks. However, if people forgot register the ad network at the first place, he/she will not update this test case as well. So we end up not catching any violation.

@erwinmombay
Copy link
Member

LGTM, but threw in my 2c

@lannka lannka merged commit 0c2ed0d into ampproject:master Aug 1, 2016
@lannka lannka deleted the 3pintegrationtest branch August 1, 2016 23:30
ariangibson pushed a commit to Mixpo/amphtml that referenced this pull request Sep 7, 2016
mityaha pushed a commit to ooyala/amphtml that referenced this pull request Nov 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants