Skip to content

Commit

Permalink
tests: remove work-a-round for qunit test runner CSP violation
Browse files Browse the repository at this point in the history
This is not needed anymore after CSP violations have been fixed upstream
by qunitjs/qunit#1369.
  • Loading branch information
jelhan committed Feb 22, 2019
1 parent 8ebeb26 commit 4e83269
Show file tree
Hide file tree
Showing 2 changed files with 479 additions and 100 deletions.
13 changes: 1 addition & 12 deletions tests/test-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,7 @@ if (typeof Promise === 'undefined') {
window.Promise = EmberPromise;
}

document.addEventListener('securitypolicyviolation', function({ blockedURI, target, violatedDirective }) {
// ignore CSP violation by qunit
// This couldn't be whitelisted using SHA hash cause it's style-src-attribute violation.
// Could be removed after upstream fix is merged and released upstream:
// https://github.com/qunitjs/qunit/pull/1369
if (
violatedDirective.startsWith('style-src') &&
target.parentNode.id === 'qunit-modulefilter-actions'
) {
return;
}

document.addEventListener('securitypolicyviolation', function({ blockedURI, violatedDirective }) {
throw new Error(
'Content-Security-Policy violation detected: ' +
`Violated directive: ${violatedDirective}. ` +
Expand Down
Loading

0 comments on commit 4e83269

Please sign in to comment.