@@ -15,6 +15,7 @@ import {
15
15
import { pathToFileURL } from 'url' ;
16
16
17
17
jest . setTimeout ( 1000 * 10 ) ;
18
+ jest . useFakeTimers ( ) . setSystemTime ( new Date ( '2025-01-01T00:00:00.000Z' ) ) ;
18
19
19
20
const projectRoot = path . resolve (
20
21
__dirname ,
@@ -143,7 +144,7 @@ describe('test', () => {
143
144
'[\n {\n "ok": false,\n "code": 2114,\n "error": "",\n "path": "invalid_file.txt"\n }\n]' ,
144
145
sarifStringifiedResults : `{\n "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",\n "version": "2.1.0",\n "runs": [\n {\n "originalUriBaseIds": {\n "PROJECTROOT": {\n "uri": "${
145
146
pathToFileURL ( path . join ( process . cwd ( ) , '/' ) ) . href
146
- } ",\n "description": {\n "text": "The root directory for all project files."\n }\n }\n },\n "tool": {\n "driver": {\n "name": "Snyk IaC",\n "fullName": "Snyk Infrastructure as Code",\n "version": "1.0.0-monorepo",\n "informationUri": "https://docs.snyk.io/products/snyk-infrastructure-as-code",\n "rules": []\n }\n },\n "automationDetails": {\n "id": "snyk-iac "\n },\n "results": []\n }\n ]\n}`,
147
+ } ",\n "description": {\n "text": "The root directory for all project files."\n }\n }\n },\n "tool": {\n "driver": {\n "name": "Snyk IaC",\n "fullName": "Snyk Infrastructure as Code",\n "version": "1.0.0-monorepo",\n "informationUri": "https://docs.snyk.io/products/snyk-infrastructure-as-code",\n "rules": []\n }\n },\n "automationDetails": {\n "id": "Snyk/IaC/2025-01-01T00:00:00.000Z "\n },\n "results": []\n }\n ]\n}`,
147
148
fields : {
148
149
path : 'invalid_file.txt' ,
149
150
} ,
@@ -258,7 +259,7 @@ describe('test', () => {
258
259
'[\n {\n "ok": false,\n "code": 2114,\n "error": "",\n "path": "invalid_file.txt"\n }\n]' ,
259
260
sarifStringifiedResults : `{\n "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",\n "version": "2.1.0",\n "runs": [\n {\n "originalUriBaseIds": {\n "PROJECTROOT": {\n "uri": "${
260
261
pathToFileURL ( path . join ( process . cwd ( ) , '/' ) ) . href
261
- } ",\n "description": {\n "text": "The root directory for all project files."\n }\n }\n },\n "tool": {\n "driver": {\n "name": "Snyk IaC",\n "fullName": "Snyk Infrastructure as Code",\n "version": "1.0.0-monorepo",\n "informationUri": "https://docs.snyk.io/products/snyk-infrastructure-as-code",\n "rules": []\n }\n },\n "automationDetails": {\n "id": "snyk-iac "\n },\n "results": []\n }\n ]\n}`,
262
+ } ",\n "description": {\n "text": "The root directory for all project files."\n }\n }\n },\n "tool": {\n "driver": {\n "name": "Snyk IaC",\n "fullName": "Snyk Infrastructure as Code",\n "version": "1.0.0-monorepo",\n "informationUri": "https://docs.snyk.io/products/snyk-infrastructure-as-code",\n "rules": []\n }\n },\n "automationDetails": {\n "id": "Snyk/IaC/2025-01-01T00:00:00.000Z "\n },\n "results": []\n }\n ]\n}`,
262
263
fields : {
263
264
path : 'invalid_file.txt' ,
264
265
} ,
@@ -363,18 +364,18 @@ describe('test', () => {
363
364
innerError : undefined ,
364
365
userMessage : `{\n "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",\n "version": "2.1.0",\n "runs": [\n {\n "originalUriBaseIds": {\n "PROJECTROOT": {\n "uri": "${
365
366
pathToFileURL ( path . join ( process . cwd ( ) , '/' ) ) . href
366
- } ",\n "description": {\n "text": "The root directory for all project files."\n }\n }\n },\n "tool": {\n "driver": {\n "name": "Snyk IaC",\n "fullName": "Snyk Infrastructure as Code",\n "version": "1.0.0-monorepo",\n "informationUri": "https://docs.snyk.io/products/snyk-infrastructure-as-code",\n "rules": []\n }\n },\n "automationDetails": {\n "id": "snyk-iac "\n },\n "results": []\n }\n ]\n}`,
367
+ } ",\n "description": {\n "text": "The root directory for all project files."\n }\n }\n },\n "tool": {\n "driver": {\n "name": "Snyk IaC",\n "fullName": "Snyk Infrastructure as Code",\n "version": "1.0.0-monorepo",\n "informationUri": "https://docs.snyk.io/products/snyk-infrastructure-as-code",\n "rules": []\n }\n },\n "automationDetails": {\n "id": "Snyk/IaC/2025-01-01T00:00:00.000Z "\n },\n "results": []\n }\n ]\n}`,
367
368
formattedUserMessage : `{\n "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",\n "version": "2.1.0",\n "runs": [\n {\n "originalUriBaseIds": {\n "PROJECTROOT": {\n "uri": "${
368
369
pathToFileURL ( path . join ( process . cwd ( ) , '/' ) ) . href
369
- } ",\n "description": {\n "text": "The root directory for all project files."\n }\n }\n },\n "tool": {\n "driver": {\n "name": "Snyk IaC",\n "fullName": "Snyk Infrastructure as Code",\n "version": "1.0.0-monorepo",\n "informationUri": "https://docs.snyk.io/products/snyk-infrastructure-as-code",\n "rules": []\n }\n },\n "automationDetails": {\n "id": "snyk-iac "\n },\n "results": []\n }\n ]\n}`,
370
+ } ",\n "description": {\n "text": "The root directory for all project files."\n }\n }\n },\n "tool": {\n "driver": {\n "name": "Snyk IaC",\n "fullName": "Snyk Infrastructure as Code",\n "version": "1.0.0-monorepo",\n "informationUri": "https://docs.snyk.io/products/snyk-infrastructure-as-code",\n "rules": []\n }\n },\n "automationDetails": {\n "id": "Snyk/IaC/2025-01-01T00:00:00.000Z "\n },\n "results": []\n }\n ]\n}`,
370
371
json : `{\n "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",\n "version": "2.1.0",\n "runs": [\n {\n "originalUriBaseIds": {\n "PROJECTROOT": {\n "uri": "${
371
372
pathToFileURL ( path . join ( process . cwd ( ) , '/' ) ) . href
372
- } ",\n "description": {\n "text": "The root directory for all project files."\n }\n }\n },\n "tool": {\n "driver": {\n "name": "Snyk IaC",\n "fullName": "Snyk Infrastructure as Code",\n "version": "1.0.0-monorepo",\n "informationUri": "https://docs.snyk.io/products/snyk-infrastructure-as-code",\n "rules": []\n }\n },\n "automationDetails": {\n "id": "snyk-iac "\n },\n "results": []\n }\n ]\n}`,
373
+ } ",\n "description": {\n "text": "The root directory for all project files."\n }\n }\n },\n "tool": {\n "driver": {\n "name": "Snyk IaC",\n "fullName": "Snyk Infrastructure as Code",\n "version": "1.0.0-monorepo",\n "informationUri": "https://docs.snyk.io/products/snyk-infrastructure-as-code",\n "rules": []\n }\n },\n "automationDetails": {\n "id": "Snyk/IaC/2025-01-01T00:00:00.000Z "\n },\n "results": []\n }\n ]\n}`,
373
374
jsonStringifiedResults :
374
375
'[\n {\n "ok": false,\n "code": 2114,\n "error": "",\n "path": "invalid_file.txt"\n }\n]' ,
375
376
sarifStringifiedResults : `{\n "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",\n "version": "2.1.0",\n "runs": [\n {\n "originalUriBaseIds": {\n "PROJECTROOT": {\n "uri": "${
376
377
pathToFileURL ( path . join ( process . cwd ( ) , '/' ) ) . href
377
- } ",\n "description": {\n "text": "The root directory for all project files."\n }\n }\n },\n "tool": {\n "driver": {\n "name": "Snyk IaC",\n "fullName": "Snyk Infrastructure as Code",\n "version": "1.0.0-monorepo",\n "informationUri": "https://docs.snyk.io/products/snyk-infrastructure-as-code",\n "rules": []\n }\n },\n "automationDetails": {\n "id": "snyk-iac "\n },\n "results": []\n }\n ]\n}`,
378
+ } ",\n "description": {\n "text": "The root directory for all project files."\n }\n }\n },\n "tool": {\n "driver": {\n "name": "Snyk IaC",\n "fullName": "Snyk Infrastructure as Code",\n "version": "1.0.0-monorepo",\n "informationUri": "https://docs.snyk.io/products/snyk-infrastructure-as-code",\n "rules": []\n }\n },\n "automationDetails": {\n "id": "Snyk/IaC/2025-01-01T00:00:00.000Z "\n },\n "results": []\n }\n ]\n}`,
378
379
fields : {
379
380
path : 'invalid_file.txt' ,
380
381
} ,
0 commit comments