Fixes this failure:
1) Mustache CLI without partials writes rendered template into the file specified by the third argument:
Uncaught TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at makeCallback (fs.js:136:11)
at Object.unlink (fs.js:943:14)
at test/cli-test.js:86:12
at ChildProcess.exithandler (child_process.js:285:7)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Primarily because it's very painful to install 3rd party packages
in the test phase of our CI runs, because many of them requires at least
Node.js 0.10 or even higher.
Therefore getting the test suite to run when using Node.js 0.8 is
far from trivial, and the benefit of ensure Node.js 0.8 support these
days is not obvious because it should really not be used knowing that
it has reached end-of-life a long time ago.
Worth noting there's no breaking changes in this commit to
mustache.js's source code, we just don't want to struggle getting our
CI to care about it. In other words, it should still be possible to use
Node.js 0.8, but we won't care much making sure it keeps working going
forward.
As of writing this, we cannot use the latest version of eslint v2.x
because there's something in there that causes explotions when run
with pre Node.js 1 installed.
* prevent value from being returned by Context.prototype.lookup if lookupHit is false
* add test for renderability of Array.length via dot notation
* Remove `typeof obj === 'object'` constraint in prop lookup
Allows rendering properties of primitive types that are not objects, such as a string.
* pop lookup needs to use hasOwnProperty for non-objs
* re-add constraint in prop lookup, but make property lookups for primitives possible through dot notation
* add test to address #589 specifically
* enhance readability of primitiveHasOwnProperty and add comments to explain why it is used in one case but not the other
Pull requests #643 and #664 together fix the issue reported in issue #617, but the change in behavior is causing semvers concerns. See issue #669. Therefore, roll back #643 and #664 and later reintroduce in next planned major release (v3.0).
Fixes#669
I made most of the `CHANGELOG.md` changes 2 August, but did not push the
version to npm until 7 August. Updating the changelog just in case anyone
updates and looks back on the changelog for clues of when things happen.
Previously when replacing dependency installation with `npm` rather than
`rake`, there were still install task references found in `Rakefile`
which should have been removed as well.
```
$ npm version patch
v2.3.1
...
npm ERR! > minifying `mustache.js`...
npm ERR! rake aborted!
npm ERR! Don't know how to build task 'install_uglify'
```
Those `install_*` tasks does not exist anymore, as installing those
dependencies are done with npm now.
Refs https://github.com/janl/mustache.js/pull/666
These changes makes zuul use ngrok for exposing itself to the outside world, rather than the default localtunnel implementation. That's because we've had quite a lot of issues with flakyness which seems to be related to localtunnel, e.g.:
```
- starting: <internet explorer 9 on Windows 2008>
events.js:160
throw er; // Unhandled 'error' event
^
Error: connection refused: localtunnel.me:44896 (check your firewall settings)
at Socket.<anonymous> (/home/travis/build/janl/mustache.js/node_modules/localtunnel/client.js:84:32)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1290:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
```
I thought this was fixed by [using Node.js 6 instead of Node.js 4](https://github.com/janl/mustache.js/pull/667), but sadly that was not the case as it re-appeared with Node.js 6 as well.
Had to use a [custom version of zuul-ngrok](https://github.com/rase-/zuul-ngrok/pull/12) which contains a newer version of ngrok. The dependency used by the upstream module threw an error when running on my computer, the updated version worked as a charm though. We should change to using the upstream module as soon as the PR with that ngrok version bump lands.
Set `concurrency: 1` otherwise ngrok would fail and make IE11 tests stall forever because of too many connections being made within a short time period. I've notice it can take quite some time (20+ minutes) to get all the tests through as it seems ngrok still seems to throttle the connections somehow, but the important thing is getting these tests to work.
For a long time we've struggled getting the browser test suite to run
on sauce labs. Those tests were running on Node.js 4 which is getting
quite old.
In a trial-n-error effort, I tried adding Node.js 6 as one of the
versions to run on Travis CI, and at the same time ensure the browsers
tests were run on that version instead of Node.js 4 -- voila the suite
passed right away.
It therefore seemed like the issues we were seeing had to do with us
running those tests via Node.js 4.
For a long time, we've been installing npm v2.x before running tests
on Travis CI across all Node.js versions.
While doing some testing today, I observed that we were able to install
dependencies and run all tests just fine on all Node.js versions, except
for v0.8. Therefore ensure we only force an install of npm v2.x when
running tests on Node.js 0.8, and keep the installed npm version as is
for all other Node.js versions.
Previously mocha, uglifyjs and jshint used when publishing a new version were ensured / installed by `Rakefile` via the pre-commit git hook. Those modules were automatically installed globally if not present in `$PATH`.
Installing modules globally has one particular downside that we should avoid: we can't ensure developers publishing new mustache.js versions have the same version of these 3rd party modules installed.
If instead we make these modules local dev dependencies, we can ensure which versions are installed, and we make 3rd party dependencies explicit by listing them in `package.json`, rather than in `Rakefile`.
First shot at getting greenkeeper to ignoring eslint updates landed with commit 85fa743258.
Sadly that commit had a minor `greenkeper` misspelling in package.json, which obviously didn't have much effect for greenkeeper.
This commit fixes that blooper in hopes that greenkeeper will stop opening PRs about new eslint versions, as we don't want to
update at the moment cause eslint 3.x requires Node.js v4.x.
When using amdclean to create a footprint less javascript file, the object needs to be returned to let it properly be assigned to the created script variable.
* Fixes CLI tests for windows
* Hijacked exec so we don't have to wrap each command in changeForOS, and made replacing 'cat' safer with word boundaries
* Fixing changed tests to be more consistent with the code base