An experiment in sharing client/server side code with node, TDD with buster.js, packaging with RequireJS
JavaScript Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
externals
node_modules
src
test
.gitignore
.gitmodules
README.md
build-and-test.sh
buster.js
buster.minified.js
require.build.js
run-app.sh

README.md

An experiment in TDD, nodejs, progressive enhancement, fancy stuff.

Very much a work in progress.

Set up

  • npm install -g buster

Running tests

  • Start buster server
  • Point browsers, which need to run tests, to http://localhost:1111
  • buster test to run tests on raw JS (both, server and client side)
  • ./buld-and-test.sh to minify client side JS into min/all.js and run the same tests against it

File naming convention

The file names in test folder should map directly to file names in src folder (the * part, anyways)

  • src/
    • *.node.js - does not get concantenated into the all.js for browser
    • *.js - files that may be needed in the browser
  • test/
    • *.test.node.js - only included when buster test runs for node
    • *.test.js - runs in both - browser and node
    • To run tests ONLY in the browser, the file should be *.test.js and also have requiresSupportFor: { "DOM": typeof document != "undefined" }, in the testCase

Libraries

Notes to self

  • Problem: amdefine boilerplate is PITA
  • Problem: test boilerplate is PITA - test name for buster; module name for [am]define
  • Problem: three copies of handlebars - externals/runtime, externals/hbs, node_modules
  • @todo: use runtime version of handlebars