Closed davidcheung closed 8 years ago
@davidcheung take a look at tests in loopback-angular-sdk-cli and grunt-loopback-angular-sdk. We need a simple smoke test to verify that the gulp plugin called the SDK codegen correctly, for example by checking few regular expressions (does the code contain the module name lbServices
, etc.). There is no need to check file size.
@bajtos agreed. the current test does a size.length
as well as checking for the module in the generated file.
assert(/var urlBase = "\/rest-api-root";/.test(file.contents));
assert(/var module = angular.module\("lbServices", \['ngResource'\]\);/
.test(file.contents));
Reason
Right now the test checks for file size matching, which means everytime master of angular changes, we need to manually update the
fixtures/lb-services.js
, Right now if notmaster
/jenkins/npm-released are the same version, likely one will fail.Goal
Goal is to change test to not match file.length due to high maintenance.
Alternatives
<%
cc/ @bajtos