|
8 | 8 | * Frozen constants for consistent package operations. |
9 | 9 | */ |
10 | 10 |
|
11 | | -import process from 'node:process' |
| 11 | +import { describe, expect, it } from 'vitest' |
| 12 | + |
12 | 13 | import { |
13 | 14 | AT_LATEST, |
14 | 15 | LATEST, |
15 | 16 | PACKAGE, |
16 | 17 | PACKAGE_DEFAULT_VERSION, |
17 | 18 | getLifecycleScriptNames, |
18 | | - getNpmLifecycleEvent, |
19 | 19 | getPackageDefaultNodeRange, |
20 | 20 | getPackageDefaultSocketCategories, |
21 | 21 | getPackageExtensions, |
22 | 22 | getPackumentCache, |
23 | 23 | getPacoteCachePath, |
24 | 24 | } from '@socketsecurity/lib/constants/packages' |
25 | | -import { describe, expect, it } from 'vitest' |
26 | 25 |
|
27 | 26 | describe('constants/packages', () => { |
28 | 27 | describe('package constants', () => { |
@@ -124,20 +123,6 @@ describe('constants/packages', () => { |
124 | 123 | }) |
125 | 124 | }) |
126 | 125 |
|
127 | | - describe('getNpmLifecycleEvent', () => { |
128 | | - it('should return string or undefined', () => { |
129 | | - const event = getNpmLifecycleEvent() |
130 | | - const type = typeof event |
131 | | - expect(type === 'string' || type === 'undefined').toBe(true) |
132 | | - }) |
133 | | - |
134 | | - it('should match npm_lifecycle_event env var', () => { |
135 | | - const event = getNpmLifecycleEvent() |
136 | | - const envValue = process.env['npm_lifecycle_event'] |
137 | | - expect(event).toBe(envValue) |
138 | | - }) |
139 | | - }) |
140 | | - |
141 | 126 | describe('getLifecycleScriptNames', () => { |
142 | 127 | it('should return array', () => { |
143 | 128 | const scripts = getLifecycleScriptNames() |
@@ -266,15 +251,6 @@ describe('constants/packages', () => { |
266 | 251 | expect(arr.length).toBeGreaterThanOrEqual(0) |
267 | 252 | }) |
268 | 253 |
|
269 | | - it('should handle undefined npm lifecycle event', () => { |
270 | | - const event = getNpmLifecycleEvent() |
271 | | - if (event === undefined) { |
272 | | - expect(typeof event).toBe('undefined') |
273 | | - } else { |
274 | | - expect(typeof event).toBe('string') |
275 | | - } |
276 | | - }) |
277 | | - |
278 | 254 | it('should handle empty lifecycle script names', () => { |
279 | 255 | const scripts = getLifecycleScriptNames() |
280 | 256 | expect(scripts.length).toBeGreaterThanOrEqual(0) |
|
0 commit comments