",
@@ -499,7 +500,7 @@
"engines": {
"node": ">= 10"
},
- "version": "6.3.20",
+ "version": "6.4.0",
"license": "MIT",
"scripts": {
"lint": "eslint . --ext js --ignore-pattern *.tpl.js",
diff --git a/test/unit/middleware/karma.spec.js b/test/unit/middleware/karma.spec.js
index 4f6b873c2..db9c5819b 100644
--- a/test/unit/middleware/karma.spec.js
+++ b/test/unit/middleware/karma.spec.js
@@ -17,8 +17,8 @@ describe('middleware.karma', () => {
let response
class MockFile extends File {
- constructor (path, sha, type, content) {
- super(path, undefined, undefined, type)
+ constructor (path, sha, type, content, integrity) {
+ super(path, undefined, undefined, type, undefined, integrity)
this.sha = sha || 'sha-default'
this.content = content
}
@@ -230,6 +230,21 @@ describe('middleware.karma', () => {
callHandlerWith('/__karma__/context.html')
})
+ it('should serve context.html with script tags with integrity checking', (done) => {
+ includedFiles([
+ new MockFile('/first.js', 'sha123'),
+ new MockFile('/second.js', 'sha456', undefined, undefined, 'sha256-XXX')
+ ])
+
+ response.once('end', () => {
+ expect(nextSpy).not.to.have.been.called
+ expect(response).to.beServedAs(200, 'CONTEXT\n\n')
+ done()
+ })
+
+ callHandlerWith('/__karma__/context.html')
+ })
+
it('should serve context.html with replaced link tags', (done) => {
includedFiles([
new MockFile('/first.css', 'sha007'),
@@ -242,7 +257,7 @@ describe('middleware.karma', () => {
response.once('end', () => {
expect(nextSpy).not.to.have.been.called
- expect(response).to.beServedAs(200, 'CONTEXT\n \n \n \n \n \n ')
+ expect(response).to.beServedAs(200, 'CONTEXT\n \n \n \n \n \n ')
done()
})
@@ -278,7 +293,22 @@ describe('middleware.karma', () => {
response.once('end', () => {
expect(nextSpy).not.to.have.been.called
- expect(response).to.beServedAs(200, 'CONTEXT\n \n \n \n \n \n \n \n ')
+ expect(response).to.beServedAs(200, 'CONTEXT\n \n \n \n \n \n \n \n ')
+ done()
+ })
+
+ callHandlerWith('/__karma__/context.html')
+ })
+
+ it('should serve context.html with link tags with integrity checking', (done) => {
+ includedFiles([
+ new MockFile('/first.css', 'sha007', undefined, undefined, 'sha256-XXX'),
+ new MockFile('/second.html', 'sha678', undefined, undefined, 'sha256-XXX')
+ ])
+
+ response.once('end', () => {
+ expect(nextSpy).not.to.have.been.called
+ expect(response).to.beServedAs(200, 'CONTEXT\n \n ')
done()
})
@@ -447,7 +477,7 @@ describe('middleware.karma', () => {
response.once('end', () => {
expect(nextSpy).not.to.have.been.called
- expect(response).to.beServedAs(200, 'DEBUG\n \n \n \n \n \n \n \n ')
+ expect(response).to.beServedAs(200, 'DEBUG\n \n \n \n \n \n \n \n ')
done()
})
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy