This adds some a basic integration tests for sample/js/{counter,fs}.
It work pretty much like this:
- Run `npm install`
- Do setup (good place to initialize the database) (optional).
- Start a http store from go.
- Run `node . <args...>`. The IntegrationTestSuite has convenience
methods to get the spec.
- Do teardown, which is a good time to check the output and the current state of the db (optional).
Towards #1888
* Revert "Revert "Share node_modules for samples/js" (#1967)"
This reverts commit 7bb1623e99.
* Add parent directory to the PATH
* Change run-all-js-tests to run samples/js before samples/js/**
* Fix a temporary comment
This is so that we do not need to do npm install 10 times in the
samples directory. Instead we do it once inside samples/js and let
all the sub directories have no dependencies. This works because
nodejs searches the parent directories when looking for a module.
Towards #1888
Also remove test util code from the two simpler Go samples. I think
we will want to distinguish between "samples" and "utilities". The
former should be as easy to understand and lightweight as possible,
while the latter will tend to be more a real part of the project
that is maintained, tuned, relied upon, etc.
The former should only rely on the Noms SDK and the Go stdlib. The
latter should follow normal Noms internal coding conventions.
Instead of writing blobs using base64 we now write the values as
hex (16 per row)
Blob(00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f\n10)
Towards #1837
As one step towards #1819, we've created MapMutator, which can take a
bunch of (what would normally be) Map.Set() calls and batch them up to
be applied all at once. The keys and values are held in a LevelDB cache
until everything's done. Usage looks like this:
m := types.NewMap()
mx := m.Mx()
mx = mx.Set(String("foo"), String("bar")).Set(String("baz"), Number(42))
m = mx.Finish()
We intend to make this the only way to modify collections, but at first
this will only work on an empty NomsMap.