tests should fail if violating CSP

This commit is contained in:
Jeldrik Hanschke 2019-02-23 22:43:53 +01:00 committed by jelhan
parent 68822aaa0f
commit ac96aaf044

View file

@ -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();