Skip to content

Commit bf0cd25

Browse files
KAROTT7sapphi-red
andauthored
docs(legacy): add test case to ensure correct csp hashes in readme.md (#13384)
Co-authored-by: sapphi-red <[email protected]>
1 parent 2872d55 commit bf0cd25

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

packages/plugin-legacy/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ The legacy plugin requires inline scripts for [Safari 10.1 `nomodule` fix](https
159159

160160
- `sha256-MS6/3FCg4WjP9gwgaBGwLpRCY6fZBgwmhVCdrPrNf3E=`
161161
- `sha256-tQjf8gvb2ROOMapIxFvFAYBeUJ0v1HCbOcSmDNXGtDo=`
162-
- `sha256-p7PoC97FO+Lu90RNjGWxhbm13yALSR4xzV8vaDhaQBo=`
162+
- `sha256-4y/gEB2/KIwZFTfNqwXJq4olzvmQ0S214m9jwKgNXoc=`
163163
- `sha256-+5XkZFazzJo8n0iOP4ti/cLCMUudTf//Mzkb7xNPXIc=`
164164

165165
<!--
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import fs from 'node:fs'
2+
import path from 'node:path'
3+
import { expect, test } from 'vitest'
4+
import { cspHashes } from '..'
5+
6+
test('CSP hashes in README.md should be correct', () => {
7+
const readme = fs.readFileSync(
8+
path.resolve(__dirname, '../../README.md'),
9+
'utf-8',
10+
)
11+
const hashesInDoc = [...readme.matchAll(/`sha256-(.+)`/g)].map(
12+
(match) => match[1],
13+
)
14+
15+
expect(hashesInDoc).toStrictEqual(cspHashes)
16+
})

0 commit comments

Comments
 (0)