6
6
import * as assert from 'assert'
7
7
import { Lambda } from 'aws-sdk'
8
8
import * as os from 'os'
9
- import {
10
- DefaultLambdaFunctionGroupNode ,
11
- DefaultLambdaFunctionNode ,
12
- LambdaFunctionNode
13
- } from '../../../lambda/explorer/lambdaNodes'
9
+ import { LambdaFunctionNode , LambdaNode } from '../../../lambda/explorer/lambdaNodes'
14
10
import { CloudFormationClient } from '../../../shared/clients/cloudFormationClient'
15
11
import { EcsClient } from '../../../shared/clients/ecsClient'
16
12
import { LambdaClient } from '../../../shared/clients/lambdaClient'
@@ -26,7 +22,7 @@ async function* asyncGenerator<T>(items: T[]): AsyncIterableIterator<T> {
26
22
yield * items
27
23
}
28
24
29
- describe ( 'DefaultLambdaFunctionNode ' , ( ) => {
25
+ describe ( 'LambdaFunctionNode ' , ( ) => {
30
26
let fakeFunctionConfig : Lambda . FunctionConfiguration
31
27
32
28
before ( async ( ) => {
@@ -78,14 +74,14 @@ describe('DefaultLambdaFunctionNode', () => {
78
74
assert . strictEqual ( childNodes . length , 0 )
79
75
} )
80
76
81
- function generateTestNode ( ) : DefaultLambdaFunctionNode {
77
+ function generateTestNode ( ) : LambdaFunctionNode {
82
78
const parentNode = new TestAWSTreeNode ( 'test node' )
83
79
84
- return new DefaultLambdaFunctionNode ( parentNode , 'someregioncode' , fakeFunctionConfig )
80
+ return new LambdaFunctionNode ( parentNode , 'someregioncode' , fakeFunctionConfig )
85
81
}
86
82
} )
87
83
88
- describe ( 'DefaultLambdaFunctionGroupNode ' , ( ) => {
84
+ describe ( 'LambdaNode ' , ( ) => {
89
85
class FunctionNamesMockLambdaClient extends MockLambdaClient {
90
86
public constructor (
91
87
public readonly functionNames : string [ ] = [ ] ,
@@ -104,7 +100,7 @@ describe('DefaultLambdaFunctionGroupNode', () => {
104
100
}
105
101
}
106
102
107
- class ThrowErrorDefaultLambdaFunctionGroupNode extends DefaultLambdaFunctionGroupNode {
103
+ class ThrowErrorLambdaNode extends LambdaNode {
108
104
public constructor ( ) {
109
105
super ( 'someregioncode' )
110
106
}
@@ -136,9 +132,9 @@ describe('DefaultLambdaFunctionGroupNode', () => {
136
132
}
137
133
}
138
134
139
- const functionGroupNode = new DefaultLambdaFunctionGroupNode ( 'someregioncode' )
135
+ const lambdaNode = new LambdaNode ( 'someregioncode' )
140
136
141
- const children = await functionGroupNode . getChildren ( )
137
+ const children = await lambdaNode . getChildren ( )
142
138
143
139
assert . ok ( children , 'Expected to get Lambda function nodes as children' )
144
140
assert . strictEqual (
@@ -157,7 +153,7 @@ describe('DefaultLambdaFunctionGroupNode', () => {
157
153
'Child node expected to contain functionName property'
158
154
)
159
155
160
- const node : DefaultLambdaFunctionNode = actualChildNode as DefaultLambdaFunctionNode
156
+ const node = actualChildNode as LambdaFunctionNode
161
157
assert . strictEqual (
162
158
node . functionName ,
163
159
expectedNodeText ,
@@ -172,7 +168,7 @@ describe('DefaultLambdaFunctionGroupNode', () => {
172
168
} )
173
169
174
170
it ( 'handles error' , async ( ) => {
175
- const testNode = new ThrowErrorDefaultLambdaFunctionGroupNode ( )
171
+ const testNode = new ThrowErrorLambdaNode ( )
176
172
177
173
const childNodes = await testNode . getChildren ( )
178
174
assert ( childNodes !== undefined )
0 commit comments