@@ -81,6 +81,47 @@ describe("index", function(){
8181 } ) ;
8282 } ) ;
8383
84+ describe ( "#from-with-as" , function ( ) {
85+ it ( "validates the Dockerfile detects latest when using as" , function ( ) {
86+ var expected = [
87+ { title : 'Base Image Latest Tag' ,
88+ line : 1 ,
89+ rule : 'latest_tag' }
90+ ] ;
91+ const lintResult = dockerfilelint . run ( './test/examples' , fs . readFileSync ( './test/examples/Dockerfile.from-as' , 'UTF-8' ) ) ;
92+ _ . forEach ( lintResult , function ( r ) {
93+ delete r [ 'description' ] ;
94+ delete r [ 'category' ] ;
95+ } ) ;
96+ expect ( lintResult ) . to . have . length ( expected . length ) ;
97+ expect ( lintResult ) . to . deep . equal ( expected ) ;
98+ } ) ;
99+ } ) ;
100+
101+ describe ( "#from-with-port" , function ( ) {
102+ it ( "validates the Dockerfile detects latest when it has a port" , function ( ) {
103+ var expected = [
104+ { title : 'Base Image Latest Tag' ,
105+ line : 1 ,
106+ rule : 'latest_tag' }
107+ ] ;
108+ const lintResult = dockerfilelint . run ( './test/examples' , fs . readFileSync ( './test/examples/Dockerfile.from-with-port' , 'UTF-8' ) ) ;
109+ _ . forEach ( lintResult , function ( r ) {
110+ delete r [ 'description' ] ;
111+ delete r [ 'category' ] ;
112+ } ) ;
113+ expect ( lintResult ) . to . have . length ( expected . length ) ;
114+ expect ( lintResult ) . to . deep . equal ( expected ) ;
115+ } ) ;
116+ } ) ;
117+
118+ describe ( "#from-with-port-no-latest" , function ( ) {
119+ it ( "validates the Dockerfile detects not latest when it has a port" , function ( ) {
120+ const lintResult = dockerfilelint . run ( './test/examples' , fs . readFileSync ( './test/examples/Dockerfile.from-with-port-no-latest' , 'UTF-8' ) ) ;
121+ expect ( lintResult ) . to . have . length ( 0 ) ;
122+ } ) ;
123+ } ) ;
124+
84125 describe ( "#shell" , function ( ) {
85126 it ( "validates the shell command is accepted when entered correctly" , function ( ) {
86127 expect ( dockerfilelint . run ( './test/examples' , fs . readFileSync ( './test/examples/Dockerfile.shell.pass' , 'UTF-8' ) ) ) . to . be . empty ;
0 commit comments