tests should fail if violating CSP
This commit is contained in:
parent
68822aaa0f
commit
ac96aaf044
1 changed files with 8 additions and 0 deletions
|
@ -3,6 +3,14 @@ import config from '../config/environment';
|
||||||
import { setApplication } from '@ember/test-helpers';
|
import { setApplication } from '@ember/test-helpers';
|
||||||
import { start } from 'ember-qunit';
|
import { start } from 'ember-qunit';
|
||||||
|
|
||||||
|
document.addEventListener('securitypolicyviolation', function({ blockedURI, violatedDirective }) {
|
||||||
|
throw new Error(
|
||||||
|
'Content-Security-Policy violation detected: ' +
|
||||||
|
`Violated directive: ${violatedDirective}. ` +
|
||||||
|
`Blocked URI: ${blockedURI}`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
setApplication(Application.create(config.APP));
|
setApplication(Application.create(config.APP));
|
||||||
|
|
||||||
start();
|
start();
|
||||||
|
|
Loading…
Reference in a new issue