Open donohutcheon opened 8 years ago
I'd like to submit a patch for this bug that will correct the problem. _.server.routes.tests.js.zip
@donohutcheon Can you submit a PR for it?
No problem. I'm new to GitHub but keen to help. What's the protocol? Do I need permissions to create a new branch?
You fork the repo, create a branch on your repo, make your changes and commit, then create a PR from your branch on your fork to the master branch of this repo as the base.
The bug is reproducible by following the following Youtube video MeanJS - MEAN stack Yeoman Generator Tutorial from 3:47 up to 5:54.
The problem occurs because the
crud-module/templates/tests/server/_.server.routes.tests.js
file refers to a variable named<%= camelizedPluralName %>GetRes
on line 89 but in the function definition on line 82 the argument is named :camelizedSingularName %>sGetErr
. For most English nouns this problem will go undetected, however in the case of Superheroes (and other plural nouns that don't end in 's') the test defines a function argument of SuperherosGetRes (line 82) but on line 89 refers to the correct plural variable name: SuperheroesGetRes.The result is that the test fails and
gulp
does not initialise the application when executed usinggulp
:Obviously there are other scenarios where the inflections module will fail to match the module name to the appropriate noun / plural noun, for example
formulae
becomesformulaes
. For this specific scenario the actual template code is inconsistent and should be fixed.