Skip to content

Commit 9626ff2

Browse files
Enhance license validation test by generating a separate key pair for invalid signature scenario
1 parent 05739bb commit 9626ff2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

react_on_rails_pro/packages/node-renderer/tests/licenseValidator.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,18 @@ describe('LicenseValidator', () => {
132132

133133
it('calls process.exit for invalid signature', () => {
134134
// Generate a different key pair for invalid signature
135-
const { privateKey: wrongKey } = crypto.generateKeyPairSync('rsa', {
135+
const wrongKeyPair = crypto.generateKeyPairSync('rsa', {
136136
modulusLength: 2048,
137+
publicKeyEncoding: {
138+
type: 'spki',
139+
format: 'pem',
140+
},
137141
privateKeyEncoding: {
138142
type: 'pkcs8',
139143
format: 'pem',
140144
},
141145
});
146+
const wrongKey = wrongKeyPair.privateKey;
142147

143148
const validPayload = {
144149

0 commit comments

Comments
 (0)