create-platformatic 0.46.1 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/ask-dir.mjs +1 -3
- package/src/composer/create-composer-cli.mjs +31 -2
- package/src/composer/create-composer.mjs +30 -6
- package/src/db/create-db.mjs +1 -1
- package/src/ghaction.mjs +17 -0
- package/src/runtime/create-runtime-cli.mjs +7 -2
- package/src/utils.mjs +0 -13
- package/test/cli-options.test.mjs +0 -84
- package/test/composer/create-composer.test.mjs +0 -75
- package/test/create-gitignore.test.mjs +0 -35
- package/test/create-package-json.test.mjs +0 -81
- package/test/db/create-db.test.mjs +0 -303
- package/test/exports.test.mjs +0 -8
- package/test/get-pkg-manager.test.mjs +0 -36
- package/test/ghaction-dynamic.test.mjs +0 -98
- package/test/ghaction-static.test.mjs +0 -97
- package/test/runtime/create-runtime.test.mjs +0 -70
- package/test/service/create-service.test.mjs +0 -155
- package/test/utils.test.mjs +0 -261
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import createService from '../../src/service/create-service.mjs'
|
|
2
|
-
import { isFileAccessible } from '../../src/utils.mjs'
|
|
3
|
-
import { test, beforeEach, afterEach } from 'tap'
|
|
4
|
-
import { tmpdir } from 'os'
|
|
5
|
-
import { mkdtempSync, rmSync, readFileSync, writeFileSync, mkdirSync } from 'fs'
|
|
6
|
-
import { join } from 'path'
|
|
7
|
-
import dotenv from 'dotenv'
|
|
8
|
-
import Ajv from 'ajv'
|
|
9
|
-
import { schema } from '@platformatic/service'
|
|
10
|
-
|
|
11
|
-
const base = tmpdir()
|
|
12
|
-
let tmpDir
|
|
13
|
-
let log = []
|
|
14
|
-
beforeEach(() => {
|
|
15
|
-
tmpDir = mkdtempSync(join(base, 'test-create-platformatic-'))
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
afterEach(() => {
|
|
19
|
-
log = []
|
|
20
|
-
rmSync(tmpDir, { recursive: true, force: true })
|
|
21
|
-
process.env = {}
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
const fakeLogger = {
|
|
25
|
-
debug: msg => log.push(msg),
|
|
26
|
-
info: msg => log.push(msg)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
test('creates service with typescript', async ({ equal, same, ok }) => {
|
|
30
|
-
const params = {
|
|
31
|
-
hostname: 'myhost',
|
|
32
|
-
port: 6666,
|
|
33
|
-
typescript: true
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
await createService(params, fakeLogger, tmpDir)
|
|
37
|
-
|
|
38
|
-
const pathToServiceConfigFile = join(tmpDir, 'platformatic.service.json')
|
|
39
|
-
const serviceConfigFile = readFileSync(pathToServiceConfigFile, 'utf8')
|
|
40
|
-
const serviceConfig = JSON.parse(serviceConfigFile)
|
|
41
|
-
const ajv = new Ajv()
|
|
42
|
-
ajv.addKeyword('resolvePath')
|
|
43
|
-
const validate = ajv.compile(schema.schema)
|
|
44
|
-
const isValid = validate(serviceConfig)
|
|
45
|
-
equal(isValid, true)
|
|
46
|
-
const { server, plugins } = serviceConfig
|
|
47
|
-
|
|
48
|
-
equal(server.hostname, '{PLT_SERVER_HOSTNAME}')
|
|
49
|
-
equal(server.port, '{PORT}')
|
|
50
|
-
|
|
51
|
-
const pathToDbEnvFile = join(tmpDir, '.env')
|
|
52
|
-
dotenv.config({ path: pathToDbEnvFile })
|
|
53
|
-
equal(process.env.PLT_SERVER_HOSTNAME, 'myhost')
|
|
54
|
-
equal(process.env.PORT, '6666')
|
|
55
|
-
equal(process.env.PLT_TYPESCRIPT, 'true')
|
|
56
|
-
|
|
57
|
-
process.env = {}
|
|
58
|
-
|
|
59
|
-
const pathToDbEnvSampleFile = join(tmpDir, '.env.sample')
|
|
60
|
-
dotenv.config({ path: pathToDbEnvSampleFile })
|
|
61
|
-
equal(process.env.PLT_SERVER_HOSTNAME, 'myhost')
|
|
62
|
-
equal(process.env.PORT, '6666')
|
|
63
|
-
equal(process.env.PLT_TYPESCRIPT, 'true')
|
|
64
|
-
|
|
65
|
-
same(plugins.paths, [{ path: './plugins', encapsulate: false }, './routes'])
|
|
66
|
-
equal(plugins.typescript, '{PLT_TYPESCRIPT}')
|
|
67
|
-
|
|
68
|
-
ok(await isFileAccessible(join(tmpDir, 'tsconfig.json')))
|
|
69
|
-
ok(await isFileAccessible(join(tmpDir, 'plugins', 'example.ts')))
|
|
70
|
-
ok(await isFileAccessible(join(tmpDir, 'routes', 'root.ts')))
|
|
71
|
-
|
|
72
|
-
ok(await isFileAccessible(join(tmpDir, 'test', 'plugins', 'example.test.ts')))
|
|
73
|
-
ok(await isFileAccessible(join(tmpDir, 'test', 'routes', 'root.test.ts')))
|
|
74
|
-
ok(await isFileAccessible(join(tmpDir, 'test', 'helper.ts')))
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
test('creates service with javascript', async ({ equal, same, ok }) => {
|
|
78
|
-
const params = {
|
|
79
|
-
hostname: 'myhost',
|
|
80
|
-
port: 6666,
|
|
81
|
-
typescript: false
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
await createService(params, fakeLogger, tmpDir)
|
|
85
|
-
|
|
86
|
-
const pathToServiceConfigFile = join(tmpDir, 'platformatic.service.json')
|
|
87
|
-
const serviceConfigFile = readFileSync(pathToServiceConfigFile, 'utf8')
|
|
88
|
-
const serviceConfig = JSON.parse(serviceConfigFile)
|
|
89
|
-
const { server, plugins } = serviceConfig
|
|
90
|
-
|
|
91
|
-
equal(server.hostname, '{PLT_SERVER_HOSTNAME}')
|
|
92
|
-
equal(server.port, '{PORT}')
|
|
93
|
-
|
|
94
|
-
const pathToDbEnvFile = join(tmpDir, '.env')
|
|
95
|
-
dotenv.config({ path: pathToDbEnvFile })
|
|
96
|
-
equal(process.env.PLT_SERVER_HOSTNAME, 'myhost')
|
|
97
|
-
equal(process.env.PORT, '6666')
|
|
98
|
-
process.env = {}
|
|
99
|
-
|
|
100
|
-
const pathToDbEnvSampleFile = join(tmpDir, '.env.sample')
|
|
101
|
-
dotenv.config({ path: pathToDbEnvSampleFile })
|
|
102
|
-
equal(process.env.PLT_SERVER_HOSTNAME, 'myhost')
|
|
103
|
-
equal(process.env.PORT, '6666')
|
|
104
|
-
|
|
105
|
-
same(plugins, { paths: [{ path: './plugins', encapsulate: false }, './routes'] })
|
|
106
|
-
ok(await isFileAccessible(join(tmpDir, 'plugins', 'example.js')))
|
|
107
|
-
ok(await isFileAccessible(join(tmpDir, 'routes', 'root.js')))
|
|
108
|
-
|
|
109
|
-
ok(await isFileAccessible(join(tmpDir, 'test', 'plugins', 'example.test.js')))
|
|
110
|
-
ok(await isFileAccessible(join(tmpDir, 'test', 'routes', 'root.test.js')))
|
|
111
|
-
ok(await isFileAccessible(join(tmpDir, 'test', 'helper.js')))
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
test('creates project with configuration already present', async ({ ok }) => {
|
|
115
|
-
const pathToServiceConfigFileOld = join(tmpDir, 'platformatic.service.json')
|
|
116
|
-
writeFileSync(pathToServiceConfigFileOld, JSON.stringify({ test: 'test' }))
|
|
117
|
-
const params = {
|
|
118
|
-
hostname: 'myhost',
|
|
119
|
-
port: 6666
|
|
120
|
-
}
|
|
121
|
-
await createService(params, fakeLogger, tmpDir)
|
|
122
|
-
ok(log.includes('Configuration file platformatic.service.json found, skipping creation of configuration file.'))
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
test('creates project with tsconfig already present', async ({ ok }) => {
|
|
126
|
-
const pathToTsConfig = join(tmpDir, 'tsconfig.json')
|
|
127
|
-
writeFileSync(pathToTsConfig, 'test')
|
|
128
|
-
const params = {
|
|
129
|
-
hostname: 'myhost',
|
|
130
|
-
port: 6666,
|
|
131
|
-
typescript: true
|
|
132
|
-
}
|
|
133
|
-
await createService(params, fakeLogger, tmpDir)
|
|
134
|
-
ok(log.includes(`Typescript configuration file ${pathToTsConfig} found, skipping creation of typescript configuration file.`))
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
test('creates project with plugins already present', async ({ ok }) => {
|
|
138
|
-
const pathToPlugins = join(tmpDir, 'plugins')
|
|
139
|
-
mkdirSync(pathToPlugins)
|
|
140
|
-
const params = {
|
|
141
|
-
hostname: 'myhost'
|
|
142
|
-
}
|
|
143
|
-
await createService(params, fakeLogger, tmpDir)
|
|
144
|
-
ok(log.includes('Plugins folder "plugins" found, skipping creation of plugins folder.'))
|
|
145
|
-
})
|
|
146
|
-
|
|
147
|
-
test('creates project with routes already present', async ({ ok }) => {
|
|
148
|
-
const pathToPlugins = join(tmpDir, 'routes')
|
|
149
|
-
mkdirSync(pathToPlugins)
|
|
150
|
-
const params = {
|
|
151
|
-
hostname: 'myhost'
|
|
152
|
-
}
|
|
153
|
-
await createService(params, fakeLogger, tmpDir)
|
|
154
|
-
ok(log.includes('Routes folder "routes" found, skipping creation of routes folder.'))
|
|
155
|
-
})
|
package/test/utils.test.mjs
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { test } from 'tap'
|
|
2
|
-
import { randomBetween, sleep, validatePath, getDependencyVersion, findDBConfigFile, findServiceConfigFile, isFileAccessible, isCurrentVersionSupported, minimumSupportedNodeVersions, findRuntimeConfigFile, findComposerConfigFile } from '../src/utils.mjs'
|
|
3
|
-
import { mkdtempSync, rmSync, writeFileSync } from 'fs'
|
|
4
|
-
import { tmpdir, platform } from 'os'
|
|
5
|
-
import { join } from 'path'
|
|
6
|
-
import esmock from 'esmock'
|
|
7
|
-
import semver from 'semver'
|
|
8
|
-
|
|
9
|
-
// esmock is broken on Node v20.6.0+
|
|
10
|
-
// Resolve once https://github.com/iambumblehead/esmock/issues/234 is fixed.
|
|
11
|
-
|
|
12
|
-
const skip = semver.gte(process.version, '20.6.0')
|
|
13
|
-
|
|
14
|
-
test('getUsername from git', { skip }, async ({ end, equal }) => {
|
|
15
|
-
const name = 'lukeskywalker'
|
|
16
|
-
const { getUsername } = await esmock.strict('../src/utils.mjs', {
|
|
17
|
-
execa: {
|
|
18
|
-
execa: (command) => {
|
|
19
|
-
if (command === 'git') {
|
|
20
|
-
return { stdout: name }
|
|
21
|
-
}
|
|
22
|
-
return ''
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
})
|
|
26
|
-
const username = await getUsername()
|
|
27
|
-
equal(username, name)
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
test('getUsername from whoami', { skip }, async ({ end, equal }) => {
|
|
31
|
-
const name = 'hansolo'
|
|
32
|
-
const { getUsername } = await esmock.strict('../src/utils.mjs', {
|
|
33
|
-
execa: {
|
|
34
|
-
execa: (command) => {
|
|
35
|
-
if (command === 'whoami') {
|
|
36
|
-
return { stdout: name }
|
|
37
|
-
}
|
|
38
|
-
return ''
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
const username = await getUsername()
|
|
43
|
-
equal(username, name)
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
test('if getUsername from git failed, it tries whoim', { skip }, async ({ end, equal }) => {
|
|
47
|
-
const name = 'lukeskywalker'
|
|
48
|
-
|
|
49
|
-
const { getUsername } = await esmock.strict('../src/utils.mjs', {
|
|
50
|
-
execa: {
|
|
51
|
-
execa: (command) => {
|
|
52
|
-
if (command === 'git') {
|
|
53
|
-
throw new Error('git failed')
|
|
54
|
-
}
|
|
55
|
-
if (command === 'whoami') {
|
|
56
|
-
return { stdout: name }
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return ''
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
const username = await getUsername()
|
|
64
|
-
equal(username, name)
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
test('if both git usern.ame and whoami fail, no username is set', { skip }, async ({ end, equal }) => {
|
|
68
|
-
const { getUsername } = await esmock.strict('../src/utils.mjs', {
|
|
69
|
-
execa: {
|
|
70
|
-
execa: (command) => {
|
|
71
|
-
if (command === 'git') {
|
|
72
|
-
throw new Error('git failed')
|
|
73
|
-
}
|
|
74
|
-
if (command === 'whoami') {
|
|
75
|
-
throw new Error('whoami failed')
|
|
76
|
-
}
|
|
77
|
-
return ''
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
const username = await getUsername()
|
|
82
|
-
equal(username, null)
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
test('getUsername - no username found', { skip }, async ({ end, equal }) => {
|
|
86
|
-
const { getUsername } = await esmock.strict('../src/utils.mjs', {
|
|
87
|
-
execa: {
|
|
88
|
-
execa: (command) => {
|
|
89
|
-
return ''
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
})
|
|
93
|
-
const username = await getUsername()
|
|
94
|
-
equal(username, null)
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
test('randomBetween', async ({ end, equal }) => {
|
|
98
|
-
const min = 1
|
|
99
|
-
const max = 10
|
|
100
|
-
const random = randomBetween(min, max)
|
|
101
|
-
equal(random >= min && random <= max, true)
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
test('sleep', async ({ equal }) => {
|
|
105
|
-
const start = Date.now()
|
|
106
|
-
await sleep(100)
|
|
107
|
-
const end = Date.now()
|
|
108
|
-
equal(end - start >= 100, true)
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
test('validatePath', async ({ end, equal, rejects, ok }) => {
|
|
112
|
-
{
|
|
113
|
-
// new folder
|
|
114
|
-
const valid = await validatePath('new-project')
|
|
115
|
-
ok(valid)
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
{
|
|
119
|
-
// existing folder
|
|
120
|
-
const valid = await validatePath('test')
|
|
121
|
-
ok(valid)
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
{
|
|
125
|
-
// current folder
|
|
126
|
-
const valid = await validatePath('.')
|
|
127
|
-
ok(valid)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (platform().indexOf('win') < 0) {
|
|
131
|
-
// not writeable folder
|
|
132
|
-
const valid = await validatePath('/')
|
|
133
|
-
ok(!valid)
|
|
134
|
-
}
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
test('getDependencyVersion', async ({ equal }) => {
|
|
138
|
-
const fastifyVersion = await getDependencyVersion('fastify')
|
|
139
|
-
// We cannot assert the exact version because it changes
|
|
140
|
-
equal(semver.valid(fastifyVersion), fastifyVersion)
|
|
141
|
-
equal(semver.gt(fastifyVersion, '4.10.0'), true)
|
|
142
|
-
})
|
|
143
|
-
|
|
144
|
-
test('findDBConfigFile', async ({ end, equal, mock }) => {
|
|
145
|
-
const tmpDir1 = mkdtempSync(join(tmpdir(), 'test-create-platformatic-'))
|
|
146
|
-
const tmpDir2 = mkdtempSync(join(tmpdir(), 'test-create-platformatic-'))
|
|
147
|
-
const config = join(tmpDir1, 'platformatic.db.yml')
|
|
148
|
-
writeFileSync(config, 'TEST')
|
|
149
|
-
equal(await findDBConfigFile(tmpDir1), 'platformatic.db.yml')
|
|
150
|
-
equal(await findDBConfigFile(tmpDir2), undefined)
|
|
151
|
-
rmSync(tmpDir1, { recursive: true, force: true })
|
|
152
|
-
rmSync(tmpDir2, { recursive: true, force: true })
|
|
153
|
-
})
|
|
154
|
-
|
|
155
|
-
test('findServiceConfigFile', async ({ end, equal, mock }) => {
|
|
156
|
-
const tmpDir1 = mkdtempSync(join(tmpdir(), 'test-create-platformatic-'))
|
|
157
|
-
const tmpDir2 = mkdtempSync(join(tmpdir(), 'test-create-platformatic-'))
|
|
158
|
-
const config = join(tmpDir1, 'platformatic.service.toml')
|
|
159
|
-
writeFileSync(config, 'TEST')
|
|
160
|
-
equal(await findServiceConfigFile(tmpDir1), 'platformatic.service.toml')
|
|
161
|
-
equal(await findServiceConfigFile(tmpDir2), undefined)
|
|
162
|
-
rmSync(tmpDir1, { recursive: true, force: true })
|
|
163
|
-
rmSync(tmpDir2, { recursive: true, force: true })
|
|
164
|
-
})
|
|
165
|
-
|
|
166
|
-
test('findComposerConfigFile', async ({ end, equal, mock }) => {
|
|
167
|
-
const tmpDir1 = mkdtempSync(join(tmpdir(), 'test-create-platformatic-'))
|
|
168
|
-
const tmpDir2 = mkdtempSync(join(tmpdir(), 'test-create-platformatic-'))
|
|
169
|
-
const config = join(tmpDir1, 'platformatic.composer.yml')
|
|
170
|
-
writeFileSync(config, 'TEST')
|
|
171
|
-
equal(await findComposerConfigFile(tmpDir1), 'platformatic.composer.yml')
|
|
172
|
-
equal(await findComposerConfigFile(tmpDir2), undefined)
|
|
173
|
-
rmSync(tmpDir1, { recursive: true, force: true })
|
|
174
|
-
rmSync(tmpDir2, { recursive: true, force: true })
|
|
175
|
-
})
|
|
176
|
-
|
|
177
|
-
test('findRuntimeConfigFile', async ({ end, equal, mock }) => {
|
|
178
|
-
const tmpDir1 = mkdtempSync(join(tmpdir(), 'test-create-platformatic-'))
|
|
179
|
-
const tmpDir2 = mkdtempSync(join(tmpdir(), 'test-create-platformatic-'))
|
|
180
|
-
const config = join(tmpDir1, 'platformatic.runtime.yml')
|
|
181
|
-
writeFileSync(config, 'TEST')
|
|
182
|
-
equal(await findRuntimeConfigFile(tmpDir1), 'platformatic.runtime.yml')
|
|
183
|
-
equal(await findRuntimeConfigFile(tmpDir2), undefined)
|
|
184
|
-
rmSync(tmpDir1, { recursive: true, force: true })
|
|
185
|
-
rmSync(tmpDir2, { recursive: true, force: true })
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
test('isFileAccessible', async ({ end, equal, mock }) => {
|
|
189
|
-
const tmpDir1 = mkdtempSync(join(tmpdir(), 'test-create-platformatic-'))
|
|
190
|
-
const config = join(tmpDir1, 'platformatic.db.yml')
|
|
191
|
-
writeFileSync(config, 'TEST')
|
|
192
|
-
equal(await isFileAccessible(config), true)
|
|
193
|
-
const config2 = join(tmpDir1, 'platformatic2.db.yml')
|
|
194
|
-
equal(await isFileAccessible(config2), false)
|
|
195
|
-
rmSync(tmpDir1, { recursive: true, force: true })
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
test('minimumSupportedNodeVersions', async ({ equal, not }) => {
|
|
199
|
-
equal(Array.isArray(minimumSupportedNodeVersions), true)
|
|
200
|
-
not(minimumSupportedNodeVersions.length, 0)
|
|
201
|
-
})
|
|
202
|
-
|
|
203
|
-
test('isCurrentVersionSupported', async ({ equal }) => {
|
|
204
|
-
const { major, minor, patch } = semver.minVersion(minimumSupportedNodeVersions[0])
|
|
205
|
-
{
|
|
206
|
-
// major - 1 not supported
|
|
207
|
-
const nodeVersion = `${major - 1}.${minor}.${patch}`
|
|
208
|
-
const supported = isCurrentVersionSupported(nodeVersion)
|
|
209
|
-
equal(supported, false)
|
|
210
|
-
}
|
|
211
|
-
{
|
|
212
|
-
// minor - 1 not supported
|
|
213
|
-
const nodeVersion = `${major}.${minor - 1}.${patch}`
|
|
214
|
-
const supported = isCurrentVersionSupported(nodeVersion)
|
|
215
|
-
equal(supported, false)
|
|
216
|
-
}
|
|
217
|
-
{
|
|
218
|
-
// v16 more than minimum is supported
|
|
219
|
-
const supported = isCurrentVersionSupported(`${major}.${minor + 2}.${patch}`)
|
|
220
|
-
equal(supported, true)
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// node version 20 test, to check greater and lesser major version
|
|
224
|
-
{
|
|
225
|
-
// v18.0.0 is not supported
|
|
226
|
-
const nodeVersion = '18.0.0'
|
|
227
|
-
const supported = isCurrentVersionSupported(nodeVersion)
|
|
228
|
-
equal(supported, false)
|
|
229
|
-
}
|
|
230
|
-
{
|
|
231
|
-
// v18.8.0 is supported
|
|
232
|
-
const nodeVersion = '18.8.0'
|
|
233
|
-
const supported = isCurrentVersionSupported(nodeVersion)
|
|
234
|
-
equal(supported, true)
|
|
235
|
-
}
|
|
236
|
-
{
|
|
237
|
-
// v20.5.1 is not supported
|
|
238
|
-
const supported = isCurrentVersionSupported('20.5.1')
|
|
239
|
-
equal(supported, false)
|
|
240
|
-
}
|
|
241
|
-
{
|
|
242
|
-
// v20.6.0 is supported
|
|
243
|
-
const nodeVersion = '20.6.0'
|
|
244
|
-
const supported = isCurrentVersionSupported(nodeVersion)
|
|
245
|
-
equal(supported, true)
|
|
246
|
-
}
|
|
247
|
-
{
|
|
248
|
-
// v19.0.0 is not supported
|
|
249
|
-
const supported = isCurrentVersionSupported('19.0.0')
|
|
250
|
-
equal(supported, false)
|
|
251
|
-
}
|
|
252
|
-
{
|
|
253
|
-
// v19.9.0 is not supported
|
|
254
|
-
const supported = isCurrentVersionSupported('19.9.0')
|
|
255
|
-
equal(supported, false)
|
|
256
|
-
}
|
|
257
|
-
for (const version of minimumSupportedNodeVersions) {
|
|
258
|
-
const supported = isCurrentVersionSupported(version)
|
|
259
|
-
equal(supported, true)
|
|
260
|
-
}
|
|
261
|
-
})
|