@@ -34,12 +34,15 @@ describe('supply chain — pnpm configuration', () => {
3434 } )
3535
3636 it ( 'pnpm-workspace.yaml sets blockExoticSubdeps: true' , ( ) => {
37- const ws = readYaml ( 'pnpm-workspace.yaml' ) as { blockExoticSubdeps ?: boolean }
37+ const ws = readYaml ( 'pnpm-workspace.yaml' ) as {
38+ blockExoticSubdeps ?: boolean
39+ }
3840 expect ( ws . blockExoticSubdeps ) . toBe ( true )
3941 } )
4042
4143 it ( 'onlyBuiltDependencies remains a small explicit allowlist (≤3 entries)' , ( ) => {
42- const allow = ( readJson ( 'package.json' ) . pnpm ?. onlyBuiltDependencies ?? [ ] ) as string [ ]
44+ const allow = ( readJson ( 'package.json' ) . pnpm ?. onlyBuiltDependencies ??
45+ [ ] ) as string [ ]
4346 expect ( Array . isArray ( allow ) ) . toBe ( true )
4447 expect ( allow . length ) . toBeLessThanOrEqual ( 3 )
4548 } )
@@ -48,7 +51,9 @@ describe('supply chain — pnpm configuration', () => {
4851describe ( 'supply chain — registry pinning (.npmrc)' , ( ) => {
4952 it ( 'pins @cipherstash scope and default registry to npmjs' , ( ) => {
5053 const npmrc = read ( '.npmrc' )
51- expect ( npmrc ) . toMatch ( / ^ @ c i p h e r s t a s h : r e g i s t r y = h t t p s : \/ \/ r e g i s t r y \. n p m j s \. o r g \/ $ / m)
54+ expect ( npmrc ) . toMatch (
55+ / ^ @ c i p h e r s t a s h : r e g i s t r y = h t t p s : \/ \/ r e g i s t r y \. n p m j s \. o r g \/ $ / m,
56+ )
5257 expect ( npmrc ) . toMatch ( / ^ r e g i s t r y = h t t p s : \/ \/ r e g i s t r y \. n p m j s \. o r g \/ $ / m)
5358 } )
5459
@@ -62,7 +67,10 @@ describe('supply chain — registry pinning (.npmrc)', () => {
6267describe ( 'supply chain — pnpm-lock.yaml integrity' , ( ) => {
6368 it ( 'every resolved package comes from registry.npmjs.org (no git/tarball deps)' , ( ) => {
6469 const lock = readYaml ( 'pnpm-lock.yaml' ) as {
65- packages ?: Record < string , { resolution ?: { tarball ?: string ; type ?: string } } >
70+ packages ?: Record <
71+ string ,
72+ { resolution ?: { tarball ?: string ; type ?: string } }
73+ >
6674 }
6775 const offenders : string [ ] = [ ]
6876 for ( const [ name , entry ] of Object . entries ( lock . packages ?? { } ) ) {
@@ -90,7 +98,11 @@ describe('supply chain — CI hardening (.github/workflows/tests.yml)', () => {
9098 string ,
9199 {
92100 strategy ?: { matrix ?: Record < string , unknown > }
93- steps : Array < { run ?: string ; uses ?: string ; with ?: Record < string , unknown > } >
101+ steps : Array < {
102+ run ?: string
103+ uses ?: string
104+ with ?: Record < string , unknown >
105+ } >
94106 }
95107 >
96108 }
@@ -105,7 +117,9 @@ describe('supply chain — CI hardening (.github/workflows/tests.yml)', () => {
105117 ( s ) => typeof s . run === 'string' && PNPM_INSTALL . test ( s . run ) ,
106118 )
107119 for ( const step of installSteps ) {
108- expect ( step . run , `${ jobName } step "${ step . run } "` ) . toMatch ( / - - f r o z e n - l o c k f i l e / )
120+ expect ( step . run , `${ jobName } step "${ step . run } "` ) . toMatch (
121+ / - - f r o z e n - l o c k f i l e / ,
122+ )
109123 }
110124 }
111125 } )
@@ -114,29 +128,40 @@ describe('supply chain — CI hardening (.github/workflows/tests.yml)', () => {
114128 for ( const [ jobName , job ] of Object . entries ( workflow . jobs ) ) {
115129 const usesPnpm = job . steps . some (
116130 ( s ) =>
117- ( typeof s . uses === 'string' && s . uses . startsWith ( 'pnpm/action-setup' ) ) ||
131+ ( typeof s . uses === 'string' &&
132+ s . uses . startsWith ( 'pnpm/action-setup' ) ) ||
118133 ( typeof s . run === 'string' && / \b p n p m \b / . test ( s . run ) ) ,
119134 )
120135 if ( ! usesPnpm ) continue
121136 const setup = job . steps . find (
122- ( s ) => typeof s . uses === 'string' && s . uses . startsWith ( 'actions/setup-node' ) ,
137+ ( s ) =>
138+ typeof s . uses === 'string' && s . uses . startsWith ( 'actions/setup-node' ) ,
123139 )
124- expect ( setup , `${ jobName } uses pnpm but lacks actions/setup-node` ) . toBeTruthy ( )
140+ expect (
141+ setup ,
142+ `${ jobName } uses pnpm but lacks actions/setup-node` ,
143+ ) . toBeTruthy ( )
125144 const nv = String ( setup ?. with ?. [ 'node-version' ] )
126145 if ( nv === '22' ) continue
127146 // Allow `${{ matrix.<key> }}` only when that matrix key resolves to
128147 // an array of versions that includes 22 — so the matrix can broaden
129148 // coverage without ever dropping the Node 22 hardening baseline.
130149 const matrixRef = nv . match ( / ^ \$ \{ \{ \s * m a t r i x \. ( [ \w - ] + ) \s * \} \} $ / )
131- expect ( matrixRef , `${ jobName } node version: expected '22' or matrix expression, got '${ nv } '` ) . toBeTruthy ( )
150+ expect (
151+ matrixRef ,
152+ `${ jobName } node version: expected '22' or matrix expression, got '${ nv } '` ,
153+ ) . toBeTruthy ( )
132154 const matrixKey = matrixRef ! [ 1 ]
133155 const versions = job . strategy ?. matrix ?. [ matrixKey ]
134156 expect (
135157 Array . isArray ( versions ) ,
136158 `${ jobName } references matrix.${ matrixKey } but no such array on strategy.matrix` ,
137159 ) . toBe ( true )
138160 const versionStrings = ( versions as unknown [ ] ) . map ( ( v ) => String ( v ) )
139- expect ( versionStrings , `${ jobName } matrix.${ matrixKey } must include 22` ) . toContain ( '22' )
161+ expect (
162+ versionStrings ,
163+ `${ jobName } matrix.${ matrixKey } must include 22` ,
164+ ) . toContain ( '22' )
140165 }
141166 } )
142167} )
@@ -156,7 +181,9 @@ describe('supply chain — automated dependency updates (Dependabot)', () => {
156181 } )
157182
158183 it ( 'github-actions ecosystem is also covered with a ≥ 3 day cooldown' , ( ) => {
159- const gha = db . updates . find ( ( u ) => u [ 'package-ecosystem' ] === 'github-actions' )
184+ const gha = db . updates . find (
185+ ( u ) => u [ 'package-ecosystem' ] === 'github-actions' ,
186+ )
160187 expect ( gha ) . toBeDefined ( )
161188 expect ( gha ?. cooldown ?. [ 'default-days' ] ) . toBeGreaterThanOrEqual ( 3 )
162189 } )
@@ -183,7 +210,9 @@ describe('supply chain — governance (CODEOWNERS)', () => {
183210 const rule = rules . find ( ( l ) => l . includes ( path ) )
184211 expect ( rule , `no CODEOWNERS rule covers ${ path } ` ) . toBeDefined ( )
185212 const owners = rule ! . split ( / \s + / ) . slice ( 1 )
186- expect ( owners , `${ path } CODEOWNERS owners` ) . toContain ( '@cipherstash/developers' )
213+ expect ( owners , `${ path } CODEOWNERS owners` ) . toContain (
214+ '@cipherstash/developers' ,
215+ )
187216 }
188217 } )
189218} )
0 commit comments