Merge pull request #9431 from mikispag/patch-1

Prefer the IDL 'nonce' property over .getAttribute('nonce')
This commit is contained in:
Tobias Koppers 2019-07-26 16:32:47 +02:00 committed by GitHub
commit edc12528fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -7,7 +7,8 @@ it("should load script with nonce 'nonce1234'", function(done) {
// if in browser context, test that nonce was added.
if (typeof document !== 'undefined') {
var script = document.querySelector('script[src="js/chunk-with-nonce.web.js"]');
expect(script.getAttribute('nonce')).toBe('nonce1234');
var nonce = script.nonce || script.getAttribute('nonce');
expect(nonce).toBe('nonce1234');
}
__webpack_nonce__ = undefined;
done();