Skip to content

Commit

Permalink
update jest test
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Oct 20, 2023
1 parent 35c6a49 commit 2d03945
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe('CspConfig', () => {
test(`adds, for example, CDN host name to directives along with 'self'`, () => {
const config = new CspConfig(defaultConfig, { default_src: ['foo.bar'] });
expect(config.header).toEqual(
"script-src 'self'; worker-src blob: 'self'; style-src 'unsafe-inline' 'self'; default-src 'self' foo.bar"
"script-src 'report-sample' 'self'; worker-src 'report-sample' 'self' blob:; style-src 'report-sample' 'self' 'unsafe-inline'; default-src 'self' foo.bar"
);
});

Expand All @@ -192,7 +192,7 @@ describe('CspConfig', () => {
/* empty */
});
expect(config.header).toEqual(
"script-src 'self'; worker-src blob: 'self'; style-src 'unsafe-inline' 'self'"
"script-src 'report-sample' 'self'; worker-src 'report-sample' 'self' blob:; style-src 'report-sample' 'self' 'unsafe-inline'"
);
});
test('Passing an empty array in additional config does not affect existing config', () => {
Expand All @@ -201,7 +201,7 @@ describe('CspConfig', () => {
worker_src: ['foo.bar'],
});
expect(config.header).toEqual(
"script-src 'self'; worker-src blob: 'self' foo.bar; style-src 'unsafe-inline' 'self'"
"script-src 'report-sample' 'self'; worker-src 'report-sample' 'self' blob: foo.bar; style-src 'report-sample' 'self' 'unsafe-inline'"
);
});
});
Expand Down

0 comments on commit 2d03945

Please sign in to comment.