Commit graph

34 commits

Author SHA1 Message Date
Leo Horie
04847785a0 Revert "Use common mock for tests."
This reverts commit f589aa2005.
2016-04-19 22:53:59 -04:00
impinball
f589aa2005 Use common mock for tests. 2016-03-02 14:10:30 -05:00
impinball
fb3a534de0 Lint old tests 2016-01-22 14:07:25 -05:00
Leo Horie
270b20a2b0 v0.2.2-rc.1 2015-12-20 09:14:28 -05:00
impinball
12b8f044f1 Convert tests to Mocha/Chai/Sinon and lint them.
Details:

1. All tests now live in `test`. All test dependencies that aren't from npm live
   in `test-deps`.

2. The QUnit tests are gone, as well as their dependencies. Half of them
   duplicated existing tests, and some of them depended on the real DOM to
   properly test.

3. All tests are now using Mocha to run the tests, Chai for assertions, and
   Sinon and Sinon Chai for testing some callbacks.

4. Tests are run through mocha-phantomjs. If you want to run just the tests,
   run `grunt mocha_phantomjs` or fire up a server in the root and open
   `http://localhost:<port>/test/index.html`, e.g. `python3 -m http.server`.

5. The linter I chose is ESLint. It is relatively easy to configure, but with a
   lot of flexibility. The rules I chose mostly were in tune to the style the
   project was already using. I'm not including a style guide in this commit,
   but one will likely come. You can check out the `.eslintrc` in the root and
   in `test/` for the two configs. The `.eslintignore` includes a TODO for
   `mithril.js` itself targeted at me, in the root.

Other info:

- As a drive-by fix, I fixed line endings on a few of the files.

- I also took care of a few other files and linted them as I went:

  - `Gruntfile.js`
  - `test/input-cursor.html` (was in `tests/`)
  - `test/svg.html` (was in `tests/`)
  - `docs/layout/tools/template-converter.html`
  - `docs/layout/tools/template-converter.js`

  I didn't test the template converter after linting it, because it needs
  further scrutiny to ensure it works with the latest version of Mithril. I
  know the API has changed a little, which is why I want to be sure.

- I simplified the `.travis.yml` file because none of the tests are run directly
  through Node anymore. They are always run in a browser of some kind.

Hopefully, this turned out all right...
2015-10-31 11:07:22 -04:00
impinball
3de01a1554 Clean up tests, resolve style differences, reduce upstream diff
This is in preparation for a PR, to reduce potential for merge conflicts
with either my PR or others', since mine will modify a large amount of
the main file.
2015-07-23 05:25:18 -04:00
impinball
9ae592ee4d Do some local style modifications and profile.
1. Do some temporary style modifications to help make the code more readable
   for profiling (with help from ESLint).
2. Profile the code, and optimize accordingly.
2015-07-23 05:17:02 -04:00
Leo Horie
57021b6b5e add tests 2015-02-06 22:08:08 -05:00
Keenan Lidral-Porter
e690134478 replace new function pattern with IIFE and fixes errors in example code 2014-12-07 15:14:38 -08:00
Leo Horie
a4c98e63e8 Fix tests for IE 2014-10-06 21:46:18 -04:00
Brian Suh
1fa946110a create test for #290 2014-10-04 12:18:22 -07:00
Leo Horie
eceea4addf document deps 2014-09-20 16:55:57 -04:00
zzmp
d14306a9ca fix mock requestAnimationFrame to allow chaining 2014-09-17 14:19:46 -07:00
Leo Horie
5db2dc8434 clean up redundant code 2014-09-16 00:29:01 -04:00
Leo Horie
5a134ecf5b fix bug when mixing keyed and unkeyed elements 2014-09-15 15:53:52 -04:00
Alec Embke
daf8160bf2 added jsonp transport 2014-08-25 10:36:26 -07:00
Leo Horie
7295b6e9e9 refactor redraw 2014-07-21 22:08:37 -04:00
Leo Horie
ccde633e92 fix double redraw when events fire simultaneously 2014-07-10 08:23:42 -04:00
Leo Horie
f46b8c9238 auto-send Content-Type header if using JSON.stringify as serialize in m.request 2014-06-26 16:32:05 -04:00
Leo Horie
81f3367be9 scroll to top on route 2014-06-18 06:46:50 -04:00
Leo Horie
4aad8619c5 fix m.trust diffing 2014-06-18 06:42:48 -04:00
Leo Horie
53672e62d7 implement keys 2014-06-13 23:33:02 -04:00
Leo Horie
b9cdd940bc ensure http errors reject promises 2014-05-26 21:57:09 -04:00
Leo Horie
63a7461657 fix diff of css rule removal 2014-05-09 22:21:43 -04:00
Leo Horie
a425bbca88 fix node index displacement by null/undefined nodes 2014-04-20 21:48:33 -04:00
Leo Horie
e65db40116 fix ordering issue in subchilds 2014-04-14 11:06:41 -04:00
Leo Horie
70496946cf fix ordering bug when mixing arrays with virtual elements 2014-04-11 15:23:22 -04:00
Leo Horie
5c9f9d782f add docs for SVG, and better tests 2014-04-10 21:36:09 -04:00
Leo Horie
1aef5dd942 Merge branch 'next' into svg
Conflicts:
	archive/v0.1.2/mithril-tests.js
	archive/v0.1.2/mithril.min.js
	archive/v0.1.2/mithril.min.map
	archive/v0.1.2/mithril.min.zip
	mithril.js
	tests/mithril-tests.js
2014-04-09 16:48:07 -04:00
Leo Horie
b972607c8d fix out-of-order issue when mixing new and old elements 2014-04-09 09:12:14 -04:00
Leo Horie
bdd016de3f community link 2014-04-06 20:24:23 -04:00
Leo Horie
48025dd16a add experimental svg support
- supports nested svg elements
- supports svg attributes
- supports xlink
2014-03-26 23:05:14 -04:00
Leo Horie
c5f3bc23aa fixing archiving 2014-03-17 21:34:48 -04:00
Leo Horie
70b2489539 initial release 2014-03-16 22:07:53 -04:00