Commit graph

292 commits

Author SHA1 Message Date
Leo
1620b147da clean up repo 2017-01-30 11:18:47 -05:00
Leo
6ab2b6b6c3 merge to next 2017-01-30 11:04:14 -05:00
Leo Horie
a2b45ff131 add integration test 2016-12-04 23:36:38 -05:00
Barney Carroll
6b2750ea59 Test case: parse [class] attribute declaration in hyperscript selector 2016-11-19 17:57:22 +00:00
Leo Horie
bc8cf4ed76 change m.request return value from stream to promise
remove m.prop
add m.Promise
update tests and examples
2016-11-13 22:44:22 -05:00
Leo Horie
aef4ab16e9 fix tests 2016-10-26 20:27:20 -04:00
Leo Horie
6514a38162 document querystring apis 2016-10-18 10:16:20 -04:00
Pierre-Yves Gerardy
4aaee178bc Fix the test of the old suite leave the new one broken 2016-09-11 17:10:34 +02:00
Pierre-Yves Gerardy
863b82b71a Break a test of the old suite 2016-09-11 16:52:54 +02:00
Pierre-Yves Gerardy
aeb5f05706 Add the old test suite to the grunt task for both local tests and CI
This relies on a hack to bypass the `mocha` detection by `grunt-mocha-phantomjs`.
The tests have to run in less than 10 seconds, which is unlikely to be problematic on current
hardware.

Alternatively, adding the following to tests/index.html also makes the old test suite compatible
with the mocha runner, but it entails loading `mocha`:

    <script src="../node_modules/mocha/mocha.js"></script>
    <script>
        mocha.setup("bdd")
        describe("dummy test", function(){
            it("is a dummy test to run the old test suite with grunt-mocha-phantomjs like the new one", function(){})
        })
        mocha.run()
    </script>
2016-09-11 16:21:45 +02:00
Pierre-Yves Gerardy
057f3a9d2f Fix the bundle and bundle tests 2016-09-03 23:28:17 +02:00
Leo Horie
f201ea73ff ensure internal streams have same constructor as public streams 2016-08-24 01:08:20 -04:00
Leo Horie
ec07d76fcd m.fragment docs
public api tests
2016-08-24 00:26:15 -04:00
Bruce Lewis
c98f663653 Render booleans as empty strings 2016-06-10 11:00:56 -04:00
Leo Horie
13fdb60f66 clean slate 2016-04-20 20:01:04 -04:00
Leo Horie
04847785a0 Revert "Use common mock for tests."
This reverts commit f589aa2005.
2016-04-19 22:53:59 -04:00
Carroll
ea946f1a0e Empty attributes. Fixes #971 2016-03-03 10:27:26 +00:00
impinball
f589aa2005 Use common mock for tests. 2016-03-02 14:10:30 -05:00
Leo Horie
4f0d479ee7 Merge branch 'lint' of https://github.com/isiahmeadows/mithril.js into isiahmeadows-lint
Conflicts:
	mithril.js
	tests/mithril-tests.js
2016-01-28 18:40:19 -05:00
Leo Horie
6b7ac83dde Merge branch 'next' of github.com:lhorie/mithril.js into next 2016-01-27 11:22:26 -05:00
Leo Horie
3de5cb8aaf allow string keys 2016-01-27 11:22:01 -05:00
impinball
0766d93bac Lint Mithril itself 2016-01-22 16:25:55 -05:00
impinball
fb3a534de0 Lint old tests 2016-01-22 14:07:25 -05:00
John Long
aad2fc3e33 Adds test 2016-01-05 15:03:52 -07:00
Leo Horie
ae60c96a69 clean up finally 2015-12-20 09:29:12 -05:00
Leo Horie
270b20a2b0 v0.2.2-rc.1 2015-12-20 09:14:28 -05:00
impinball
27a3dca013 Move unloading test to where it's supposed to be [ci skip] 2015-12-15 13:52:14 -05:00
Isiah Meadows
df62ed54f5 Merge pull request #695 from pdfernhout/next
Add an interactive test called unloadingTest.html
2015-12-15 11:40:36 -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
46775ce828 Fix another m.withAttr test 2015-08-24 23:26:06 -04:00
impinball
6320832440 Fix a test to check the correct this 2015-08-24 23:20:21 -04:00
Jakob Dam Jensen
caf1138c31 Make m.route.param() return all params #737 2015-08-18 20:44:58 +02:00
Leo Horie
7a5980631e Merge pull request #739 from dgilland/origin/feature-propify-finally
Don't pass value/reason to promise.finally callback.
2015-08-04 15:03:47 -04:00
pelonpelon
352d093d90 test for correct this on m.withAttr callback 2015-08-01 15:01:38 -05:00
Derrick Gilland
937b20984d Update promise.finally test for non-propagation of promise value to finally callback. 2015-07-27 11:29:08 -04:00
Derrick Gilland
23930871a1 Add finally to promise-like object.
Closes #680
2015-07-24 16:57:45 -04:00
Leo Horie
0d7cc43bfe Merge branch 'patch-1' of https://github.com/Naddiseo/mithril.js into Naddiseo-patch-1
Conflicts:
	tests/mithril-tests.js
2015-07-23 23:15:05 -04:00
impinball
986dde6d5f Merge remote-tracking branch 'upstream/next' into speed, unfix "fixed" version
By "fixed", I mean "screwed up, not at all following the correct version
number, and refusing to ask on Gitter what the correct version really is, and
just assuming the wrong version despite hints all over the source screaming
'THIS IS THE CORRECT VERSION, YOU STUPID IDIOT!!!'".

I feel that should be a relatively accurate explanation of the mistake I made
while working on this patch (the specific commit that introduced it was
squashed in rebasing, and another commit was easier than a revert, since the
one that introduced it also entailed a few other things).
2015-07-23 05:26:31 -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
Miles Matthias
d2812bd88d added version function to mithril and test for version function 2015-07-16 22:11:07 -06:00
Paul D. Fernhout
9836da4af1 Add unloadingTest.html
This is a test of unloading components when another component is mounted
on a different root.

The test currently fails. See Issue #694 for details.
2015-06-27 12:05:41 -04:00
Leo Horie
1e0ad6c3d7 ensure we can still redraw after a promise error that gets thrown by the exception monitor 2015-06-22 18:41:53 -04:00
Richard Eames
fe75b4c6f0 Update mithril-tests.js
Added tests for parsing empty string, and building from empty object.
This is the test case for #660
2015-06-11 16:15:44 -06:00
Jason Staten
d89810234a accept component as first argument to m() 2015-06-01 15:11:44 -06:00
Leo Horie
2d5d042131 allow m.redraw(true) to force-render component 2015-05-05 21:16:29 -04:00
Gilbert
2a61907839 Test promise-like catch 2015-05-01 16:47:19 -05:00
Leo Horie
8214d56411 clean up 2015-04-21 21:45:33 -04:00
Leo Horie
926ed2d692 teardown #571 test properly 2015-04-21 20:55:23 -04:00
Leo Horie
16bad63113 Merge pull request #575 from tobscure/redraw-all-fix
Add test case for #571
2015-04-21 20:54:23 -04:00