|
1 | 1 | import {describe, test, expect} from 'vitest' |
2 | 2 | import layerVersions from "../layers.json"; |
3 | | -import {consoleLayerArn, fpmLayerArn, functionLayerArn} from "../layers"; |
| 3 | +import {layerArn} from "../layers"; |
4 | 4 |
|
5 | 5 | // The two tests marked with concurrent will be run in parallel |
6 | 6 | describe('layers', () => { |
7 | 7 |
|
8 | 8 | test('layerVersions', () => { |
9 | 9 | expect(layerVersions).to.have.keys([ |
| 10 | + "php-85", |
10 | 11 | "php-84", |
11 | | - "php-84-fpm", |
12 | 12 | "php-83", |
13 | | - "php-83-fpm", |
14 | 13 | "php-82", |
15 | | - "php-82-fpm", |
16 | | - "php-81", |
17 | | - "php-81-fpm", |
18 | | - "php-80", |
19 | | - "php-80-fpm", |
| 14 | + "arm-php-85", |
20 | 15 | "arm-php-84", |
21 | | - "arm-php-84-fpm", |
22 | 16 | "arm-php-83", |
23 | | - "arm-php-83-fpm", |
24 | 17 | "arm-php-82", |
25 | | - "arm-php-82-fpm", |
26 | | - "arm-php-81", |
27 | | - "arm-php-81-fpm", |
28 | | - "arm-php-80", |
29 | | - "arm-php-80-fpm", |
30 | | - "console", |
31 | 18 | ]); |
32 | 19 | expect(layerVersions["php-82"]["us-east-1"]).to.be.a("string"); |
33 | 20 | }); |
34 | 21 |
|
35 | | - test('functionLayerArn', () => { |
36 | | - expect(functionLayerArn('us-east-1', '8.3')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:php-83:\d+/); |
37 | | - expect(functionLayerArn('us-east-1', '8.3', 'arm')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:arm-php-83:\d+/); |
38 | | - expect(functionLayerArn('us-east-1', '8.2')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:php-82:\d+/); |
39 | | - expect(functionLayerArn('us-east-1', '8.1', 'arm')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:arm-php-81:\d+/); |
| 22 | + test('layerArn', () => { |
| 23 | + expect(layerArn('us-east-1', '8.3')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:php-83:\d+/); |
| 24 | + expect(layerArn('us-east-1', '8.3', 'arm')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:arm-php-83:\d+/); |
| 25 | + expect(layerArn('us-east-1', '8.2')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:php-82:\d+/); |
| 26 | + expect(layerArn('us-east-1', '8.5', 'arm')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:arm-php-85:\d+/); |
40 | 27 |
|
41 | 28 | expect(() => { |
42 | | - functionLayerArn('us-east-1', '7.4', 'arm'); |
| 29 | + layerArn('us-east-1', '7.4', 'arm'); |
43 | 30 | }).toThrow('PHP version 7.4 in us-east-1 is not supported'); |
44 | 31 | }); |
45 | 32 |
|
46 | | - test('fpmLayerArn', () => { |
47 | | - expect(fpmLayerArn('us-east-1', '8.3')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:php-83-fpm:\d+/); |
48 | | - expect(fpmLayerArn('us-east-1', '8.3', 'arm')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:arm-php-83-fpm:\d+/); |
49 | | - expect(fpmLayerArn('us-east-1', '8.2')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:php-82-fpm:\d+/); |
50 | | - expect(fpmLayerArn('us-east-1', '8.1', 'arm')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:arm-php-81-fpm:\d+/); |
51 | | - |
52 | | - expect(() => { |
53 | | - fpmLayerArn('us-east-1', '7.4', 'arm'); |
54 | | - }).toThrow('PHP version 7.4 in us-east-1 is not supported'); |
55 | | - }); |
56 | | - |
57 | | - test('consoleLayerArn', () => { |
58 | | - expect(consoleLayerArn('us-east-1')).matches(/arn:aws:lambda:us-east-1:873528684822:layer:console:\d+/); |
59 | | - |
60 | | - expect(() => { |
61 | | - consoleLayerArn('us-east-99'); |
62 | | - }).toThrow('Console layer does not exist in region us-east-99'); |
63 | | - }); |
64 | | - |
65 | 33 | }); |
0 commit comments