Permalink
Browse files

Include browser tests in the build again

- Removes redundant build scripts
- Generates test bundle for browser using browserify
- Refactor `clone` implementation to use `valueOf` for `Date` objects to address issue in Firefox (~version 35)
- Refactor `_equals` for `Error` instances to no longer compare properties other than `name` and `message`
  - Safari's `Error` has `line` and `column` properties which will rarely be equal unless they're identical
- Refactor `keys` to workaround Safari bug with enumerable `length` prop on `arguments` objects
- Refactor `times` to ensure `n` is a non-negative number (fixes PhantomJS bug)
- Bumps version of testem to v0.9
  • Loading branch information...
1 parent 6141a30 commit 0d67155f8aa1dce51c3f78853d767526c0b855e1 @scott-christopher scott-christopher committed Nov 13, 2015
Showing with 28 additions and 37,103 deletions.
  1. +1 −0 .gitignore
  2. +0 −8 Makefile
  3. +0 −58 lib/test/assert-shim.js
  4. +0 −30,132 lib/test/bundle.js
  5. +0 −1,253 lib/test/expect.js
  6. +0 −21 lib/test/index.html
  7. +0 −246 lib/test/mocha.css
  8. +0 −5,339 lib/test/mocha.js
  9. +0 −10 lib/test/require-shim.js
  10. +5 −3 package.json
  11. +0 −18 scripts/testfiles
  12. +1 −1 src/internal/_clone.js
  13. +1 −4 src/internal/_equals.js
  14. +9 −2 src/keys.js
  15. +6 −1 src/times.js
  16. +5 −7 testem.json
View
@@ -8,3 +8,4 @@
/tmp
/bower_components/
/dist/gh-pages/
+/tmp-test-bundle.js
View
@@ -1,4 +1,3 @@
-MOCHA = node_modules/.bin/mocha
UGLIFY = node_modules/.bin/uglifyjs
XYZ = node_modules/.bin/xyz --repo git@github.com:ramda/ramda.git --script scripts/prepublish
@@ -38,10 +37,3 @@ setup:
.PHONY: test
test: dist/ramda.js
npm test
- find src -name '*.js' -not -path 'src/internal/*' \
- | sed 's:src/\(.*\)[.]js:exports.\1 = require("./src/\1");:' >index.js
- sed '/"main":/d' package.json >tmp
- mv tmp package.json
- $(MOCHA) -- $(shell find test -name '*.js' -not -name 'test.examplesRunner.js' -not -path 'test/helpers/*')
- git checkout -- package.json
- rm index.js
@@ -1,58 +0,0 @@
-var assert = (function() {
- var module = {};
-
- var assert = module.exports = ok;
-
- // 4. Pure assertion tests whether a value is truthy, as determined
- // by !!guard.
- // assert.ok(guard, message_opt);
- // This statement is equivalent to assert.equal(true, !!guard,
- // message_opt);. To test strictly for the value true, use
- // assert.strictEqual(true, guard, message_opt);.
-
- function ok(value, message) {
- expect(value).to.be.ok(message);
- }
- assert.ok = ok;
-
- assert.deepEqual = function deepEqual(actual, expected, message) {
- expect(actual).to.eql(expected, message);
- };
-
- // 8. The non-equivalence assertion tests for any deep inequality.
- // assert.notDeepEqual(actual, expected, message_opt);
-
- assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
- expect(actual).to.not.eql(expected, message);
- };
-
- // 9. The strict equality assertion tests strict equality, as determined by ===.
- // assert.strictEqual(actual, expected, message_opt);
-
- assert.strictEqual = function strictEqual(actual, expected, message) {
- expect(actual).to.equal(expected, message);
- };
-
- // 10. The strict non-equality assertion tests for strict inequality, as
- // determined by !==. assert.notStrictEqual(actual, expected, message_opt);
-
- assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
- expect(actual).to.not.equal(expected, message);
- };
-
- // 11. Expected to throw an error:
- // assert.throws(block, Error_opt, message_opt);
-
- assert.throws = function(block, /*optional*/ error, /*optional*/ message) {
- expect(block).to.throwError(function(e) {
- if (error) expect(e instanceof error).ok();
- }, message);
- };
-
- // EXTENSION! This is annoying to write outside this module.
- assert.doesNotThrow = function(block, /*optional*/ message) {
- expect(block).to.not.throwError(message);
- };
-
- return module.exports;
-}());
Oops, something went wrong.

0 comments on commit 0d67155

Please sign in to comment.