Debian Codegraph @

workspaces/arborist/test/fixtures/reify-cases/rebuild-foreground-scripts.js

raw
1 // generated from test/fixtures/rebuild-foreground-scripts
2 module.exports = t => {
3 const path = t.testdir({
4 "node_modules": {
5 ".package-lock.json": JSON.stringify({
6 "name": "rebuild-foreground-scripts",
7 "lockfileVersion": 2,
8 "requires": true,
9 "packages": {
10 "node_modules/a": {
11 "version": "1.2.3",
12 "hasInstallScript": true
13 },
14 "node_modules/b": {
15 "version": "1.2.3",
16 "hasInstallScript": true
17 }
18 }
19 }),
20 "a": {
21 "package.json": JSON.stringify({
22 "name": "a",
23 "version": "1.2.3",
24 "scripts": {
25 "preinstall": "node -e \"console.log('a preinstall')\"",
26 "postinstall": "node -e \"console.log('a postinstall')\"",
27 "install": "node -e \"console.log('a install')\""
28 }
29 })
30 },
31 "b": {
32 "package.json": JSON.stringify({
33 "name": "b",
34 "version": "1.2.3",
35 "scripts": {
36 "preinstall": "node -e \"console.log('b preinstall')\"",
37 "postinstall": "node -e \"console.log('b postinstall')\"",
38 "install": "node -e \"console.log('b install')\""
39 }
40 })
41 }
42 },
43 "package-lock.json": JSON.stringify({
44 "name": "rebuild-foreground-scripts",
45 "lockfileVersion": 2,
46 "requires": true,
47 "packages": {
48 "": {
49 "dependencies": {
50 "a": "",
51 "b": ""
52 }
53 },
54 "node_modules/a": {
55 "version": "1.2.3",
56 "hasInstallScript": true
57 },
58 "node_modules/b": {
59 "version": "1.2.3",
60 "hasInstallScript": true
61 }
62 },
63 "dependencies": {
64 "a": {
65 "version": "1.2.3"
66 },
67 "b": {
68 "version": "1.2.3"
69 }
70 }
71 }),
72 "package.json": JSON.stringify({
73 "dependencies": {
74 "a": "",
75 "b": ""
76 }
77 })
78 })
79 const {utimesSync} = require('fs')
80 const n = Date.now() + 10000
81 const {resolve} = require('path')
82
83 utimesSync(resolve(path, "node_modules/.package-lock.json"), new Date(n), new Date(n))
84 return path
85 }