|
1 | 1 | import assert from 'node:assert' |
2 | 2 | import { join } from 'node:path' |
3 | 3 | import { join as posixJoin } from 'node:path/posix' |
| 4 | +import { versions } from 'node:process' |
4 | 5 | import { test, describe } from 'node:test' |
5 | 6 | import { fileURLToPath } from 'node:url' |
6 | 7 |
|
7 | 8 | import build from '@netlify/build' |
| 9 | +import { satisfies } from 'semver' |
8 | 10 |
|
9 | 11 | import { getAngularVersion } from '../src/helpers/getPackageVersion.js' |
10 | 12 | import validateAngularVersion from '../src/helpers/validateAngularVersion.js' |
@@ -122,31 +124,49 @@ test('Angular 19 in an NX workspace using App Engine (Developer Preview)', async |
122 | 124 | assert.deepEqual(success, true) |
123 | 125 | }) |
124 | 126 |
|
125 | | -test('Angular 20', async () => { |
126 | | - const { severityCode, success } = await build({ |
127 | | - repositoryRoot: fileURLToPath(new URL('fixtures/angular-20', import.meta.url)), |
128 | | - }) |
129 | | - |
130 | | - assert.deepEqual(severityCode, 0) |
131 | | - assert.deepEqual(success, true) |
132 | | -}) |
133 | | - |
134 | | -test('Angular 20 Zoneless (Developer Preview)', async () => { |
135 | | - const { severityCode, success } = await build({ |
136 | | - repositoryRoot: fileURLToPath(new URL('fixtures/angular-20-zoneless', import.meta.url)), |
137 | | - }) |
138 | | - |
139 | | - assert.deepEqual(severityCode, 0) |
140 | | - assert.deepEqual(success, true) |
141 | | -}) |
| 127 | +test( |
| 128 | + 'Angular 20', |
| 129 | + { |
| 130 | + skip: !satisfies(versions.node, '>=20.11'), |
| 131 | + }, |
| 132 | + async () => { |
| 133 | + const { severityCode, success } = await build({ |
| 134 | + repositoryRoot: fileURLToPath(new URL('fixtures/angular-20', import.meta.url)), |
| 135 | + }) |
| 136 | + |
| 137 | + assert.deepEqual(severityCode, 0) |
| 138 | + assert.deepEqual(success, true) |
| 139 | + }, |
| 140 | +) |
| 141 | + |
| 142 | +test( |
| 143 | + 'Angular 20 Zoneless (Developer Preview)', |
| 144 | + { |
| 145 | + skip: !satisfies(versions.node, '>=20.11'), |
| 146 | + }, |
| 147 | + async () => { |
| 148 | + const { severityCode, success } = await build({ |
| 149 | + repositoryRoot: fileURLToPath(new URL('fixtures/angular-20-zoneless', import.meta.url)), |
| 150 | + }) |
| 151 | + |
| 152 | + assert.deepEqual(severityCode, 0) |
| 153 | + assert.deepEqual(success, true) |
| 154 | + }, |
| 155 | +) |
142 | 156 |
|
143 | 157 | describe('Angular version validation', () => { |
144 | | - test('checks version for angular 20', async () => { |
145 | | - const result = validateAngularVersion( |
146 | | - await getAngularVersion(fileURLToPath(new URL('fixtures/angular-20', import.meta.url))), |
147 | | - ) |
148 | | - assert.strictEqual(result, true) |
149 | | - }) |
| 158 | + test( |
| 159 | + 'checks version for angular 20', |
| 160 | + { |
| 161 | + skip: !satisfies(versions.node, '>=20.11'), |
| 162 | + }, |
| 163 | + async () => { |
| 164 | + const result = validateAngularVersion( |
| 165 | + await getAngularVersion(fileURLToPath(new URL('fixtures/angular-20', import.meta.url))), |
| 166 | + ) |
| 167 | + assert.strictEqual(result, true) |
| 168 | + }, |
| 169 | + ) |
150 | 170 |
|
151 | 171 | test('checks version for angular 19', async () => { |
152 | 172 | const result = validateAngularVersion( |
|
0 commit comments