-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip functions that do not use node runtime. Allows mixed runtime pro…
…jects.
- Loading branch information
John Reeves
committed
Feb 3, 2020
1 parent
6c15f35
commit 6cd5e45
Showing
4 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import {TypeScriptPlugin} from '../src/typeScriptPlugin' | ||
|
||
describe('TypeScriptPlugin', () => { | ||
it('rootFileNames includes only node runtimes', () => { | ||
const slsInstance: Serverless.Instance = { | ||
cli: { | ||
log: jest.fn() | ||
}, | ||
config: { | ||
servicePath: 'servicePath' | ||
}, | ||
service: { | ||
provider: { | ||
name: 'aws', | ||
runtime: 'nodejs99' | ||
}, | ||
package: { | ||
individually: true, | ||
include: [], | ||
exclude: [] | ||
}, | ||
functions: { | ||
func1: { | ||
handler: 'java-fn', | ||
runtime: 'java8', | ||
package: { | ||
include: [], | ||
exclude: [] | ||
} | ||
}, | ||
func2: { | ||
handler: 'node-fn', | ||
runtime: 'nodejs99', | ||
package: { | ||
include: [], | ||
exclude: [] | ||
} | ||
} | ||
}, | ||
|
||
getAllFunctions: jest.fn() | ||
}, | ||
pluginManager: { | ||
spawn: jest.fn() | ||
} | ||
} | ||
|
||
const plugin = new TypeScriptPlugin(slsInstance, {}) | ||
|
||
expect( | ||
Object.keys(plugin.nodeFunctions) | ||
).toEqual( | ||
[ | ||
'func2' | ||
], | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters