@@ -795,6 +795,51 @@ describe('validate', () => {
795795 } ) . to . throw ( / E i t h e r f u n c t i o n .h a n d l e r o r f u n c t i o n .i m a g e m u s t b e d e f i n e d / ) ;
796796 } ) ;
797797
798+ it ( 'should not throw error if container image is a simple string' , ( ) => {
799+ const testOutPath = 'test' ;
800+ const testFunctionsConfig = {
801+ func1 : {
802+ artifact : 'artifact-func1.zip' ,
803+ events : [
804+ {
805+ http : {
806+ method : 'POST' ,
807+ path : 'func1path'
808+ }
809+ } ,
810+ {
811+ nonhttp : 'non-http'
812+ }
813+ ] ,
814+ image : 'XXXX.dkr.ecr.ca-central-1.amazonaws.com/myproject/customNode:latest'
815+ }
816+ } ;
817+
818+ const testConfig = {
819+ entry : 'test' ,
820+ context : 'testcontext' ,
821+ output : {
822+ path : testOutPath
823+ } ,
824+ getFunction : func => {
825+ return testFunctionsConfig [ func ] ;
826+ }
827+ } ;
828+
829+ _ . set ( module . serverless . service , 'custom.webpack.config' , testConfig ) ;
830+ module . serverless . service . functions = testFunctionsConfig ;
831+ globSyncStub . callsFake ( filename => [ _ . replace ( filename , '*' , 'js' ) ] ) ;
832+ return expect ( module . validate ( ) ) . to . be . fulfilled . then ( ( ) => {
833+ const lib = require ( '../lib/index' ) ;
834+ const expectedLibEntries = { } ;
835+
836+ expect ( lib . entries ) . to . deep . equal ( expectedLibEntries ) ;
837+ expect ( globSyncStub ) . to . have . callCount ( 0 ) ;
838+ expect ( serverless . cli . log ) . to . not . have . been . called ;
839+ return null ;
840+ } ) ;
841+ } ) ;
842+
798843 describe ( 'google provider' , ( ) => {
799844 beforeEach ( ( ) => {
800845 _ . set ( module . serverless , 'service.provider.name' , 'google' ) ;
0 commit comments