1- import test from 'tape'
1+ import { test } from 'node:test'
2+ import assert from 'node:assert'
23import lambdaRuntimes from '../../../esm/index.js'
34
4- test ( 'Set up env' , t => {
5- t . plan ( 1 )
6- t . ok ( lambdaRuntimes , 'lambdaRuntimes is present' )
5+ test ( 'Set up env' , ( ) => {
6+ assert . ok ( lambdaRuntimes , 'lambdaRuntimes is present' )
77} )
88
9- test ( 'Exports' , t => {
10- t . plan ( 8 )
9+ test ( 'Exports' , ( ) => {
1110 let {
1211 runtimes,
1312 runtimeVersions,
@@ -17,75 +16,62 @@ test('Exports', t => {
1716 aliases,
1817 retiredRuntimes,
1918 } = lambdaRuntimes
20- t . ok ( runtimes , 'Got runtimes' )
21- t . ok ( runtimeVersions , 'Got runtimeVersions' )
22- t . ok ( runtimeList , 'Got runtimeList' )
23- t . ok ( runtimesByArchitecture , 'Got runtimesByArchitecture' )
24- t . ok ( architecturesByRuntime , 'Got architecturesByRuntime' )
25- t . ok ( aliases , 'Got aliases' )
26- t . ok ( retiredRuntimes , 'Got retiredRuntimes' )
27- t . equal ( Object . keys ( lambdaRuntimes ) . length , 7 , 'Got all properties' )
19+ assert . ok ( runtimes , 'Got runtimes' )
20+ assert . ok ( runtimeVersions , 'Got runtimeVersions' )
21+ assert . ok ( runtimeList , 'Got runtimeList' )
22+ assert . ok ( runtimesByArchitecture , 'Got runtimesByArchitecture' )
23+ assert . ok ( architecturesByRuntime , 'Got architecturesByRuntime' )
24+ assert . ok ( aliases , 'Got aliases' )
25+ assert . ok ( retiredRuntimes , 'Got retiredRuntimes' )
26+ assert . equal ( Object . keys ( lambdaRuntimes ) . length , 7 , 'Got all properties' )
2827 console . dir ( lambdaRuntimes , { depth : null } )
2928} )
3029
31- test ( 'runtimes semantics' , t => {
32- t . plan ( 1 )
30+ test ( 'runtimes semantics' , ( ) => {
3331 let { runtimes } = lambdaRuntimes
3432 Object . values ( runtimes ) . forEach ( v => {
35- if ( ! Array . isArray ( v ) ) t . fail ( `Expected an array: ${ v } ` )
33+ assert . ok ( Array . isArray ( v ) , `Expected an array: ${ v } ` )
3634 } )
37- t . pass ( 'All runtimes values are arrays' )
3835} )
3936
40- test ( 'runtimeVersions semantics' , t => {
41- t . plan ( 2 )
37+ test ( 'runtimeVersions semantics' , ( ) => {
4238 let { runtimeList, runtimeVersions } = lambdaRuntimes
4339 let list = runtimeList . filter ( r => ! r . startsWith ( 'provided' ) )
4440 list . forEach ( runtime => {
45- if ( ! runtimeVersions [ runtime ] ) t . fail ( `${ runtime } not found in runtimeVersions` )
41+ assert . ok ( runtimeVersions [ runtime ] , `${ runtime } not found in runtimeVersions` )
4642 } )
47- t . pass ( 'Found all runtimeVersions' )
48- t . equal ( list . length , Object . keys ( runtimeVersions ) . length , 'Correct number of runtimeVersions found' )
43+ assert . equal ( list . length , Object . keys ( runtimeVersions ) . length , 'Correct number of runtimeVersions found' )
4944} )
5045
51- test ( 'runtimeList semantics' , t => {
52- t . plan ( 1 )
46+ test ( 'runtimeList semantics' , ( ) => {
5347 let { runtimeList } = lambdaRuntimes
54- t . ok ( Array . isArray ( runtimeList ) , 'runtimeList is an array' )
48+ assert . ok ( Array . isArray ( runtimeList ) , 'runtimeList is an array' )
5549} )
5650
57- test ( 'runtimesByArchitecture semantics' , t => {
58- t . plan ( 1 )
51+ test ( 'runtimesByArchitecture semantics' , ( ) => {
5952 let { runtimesByArchitecture } = lambdaRuntimes
6053 Object . values ( runtimesByArchitecture ) . forEach ( v => {
61- if ( ! Array . isArray ( v ) ) t . fail ( `Expected an array: ${ v } ` )
54+ assert . ok ( Array . isArray ( v ) , `Expected an array: ${ v } ` )
6255 } )
63- t . pass ( 'All runtimesByArchitecture are arrays' )
6456} )
6557
66- test ( 'architecturesByRuntime semantics' , t => {
67- t . plan ( 1 )
58+ test ( 'architecturesByRuntime semantics' , ( ) => {
6859 let { architecturesByRuntime } = lambdaRuntimes
6960 Object . values ( architecturesByRuntime ) . forEach ( v => {
70- if ( ! Array . isArray ( v ) ) t . fail ( `Expected an array: ${ v } ` )
61+ assert . ok ( Array . isArray ( v ) , `Expected an array: ${ v } ` )
7162 } )
72- t . pass ( 'All architecturesByRuntime are arrays' )
7363} )
7464
75- test ( 'aliases semantics' , t => {
76- t . plan ( 1 )
65+ test ( 'aliases semantics' , ( ) => {
7766 let { aliases } = lambdaRuntimes
7867 Object . values ( aliases ) . forEach ( v => {
79- if ( typeof v !== 'string' ) t . fail ( `Expected a string: ${ v } ` )
68+ assert . equal ( typeof v , 'string' , `Expected a string: ${ v } ` )
8069 } )
81- t . pass ( 'All aliases are strings' )
8270} )
8371
84- test ( 'retiredRuntimes semantics' , t => {
85- t . plan ( 1 )
72+ test ( 'retiredRuntimes semantics' , ( ) => {
8673 let { retiredRuntimes } = lambdaRuntimes
8774 Object . values ( retiredRuntimes ) . forEach ( v => {
88- if ( ! Array . isArray ( v ) ) t . fail ( `Expected an array: ${ v } ` )
75+ assert . ok ( Array . isArray ( v ) , `Expected an array: ${ v } ` )
8976 } )
90- t . pass ( 'All retiredRuntimes are arrays' )
9177} )
0 commit comments