Commit Graph

894 Commits

Author SHA1 Message Date
Michael Hoffmann
9f3722bbd9 Change assert to assert.ok to fix test 2018-07-05 17:34:45 +02:00
Michael Hoffmann
260183a522 Add binding for Number.isInteger 2018-07-05 17:09:59 +02:00
Michael Hoffmann
9d3b26341e Add binding for Date.prototype.getDate 2018-07-05 17:09:59 +02:00
Nick Fitzgerald
59b3b4dc8d Headless browser testing infrastructure (#371)
* tests: Add newlines between impl methods for Project

* WIP headless browser testing with geckodriver and selenium

* Get some more of headless testing working

* Extract `console.log` invocations and print them from the console
* Ship the error message from an exception from the browser back to the command
  line
* Cleanup some "if headless" and `else` branches
* Fix killing `webpack-dev-server` in the background with `--watch-stdin`

* Fix path appending logic for Windows

* Always log logs/errors in headless mode

* Install Firefox on Travis

* Don't duplicate full test suite with `yarn`

No need to run that many tests, we should be able to get by with a smoke test
that it just works.

* headless tests: Move `run-headless.js` to its own file and `include_str!` it

* Run `rustfmt` on `tests/all/main.rs`

* guide: Add note about headless browser tests and configuration

* test: Log WASM_BINDGEN_FIREFOX_BIN_PATH in run-headless.js

* TEMP only run add_headless test in CI

* Add more logging to headless testing

* Allow headless tests to run for 60 seconds before timeout

* TEMP add logging to add_headless test

* Fix headless browser tests

* Another attempt to fix Travis

* More attempts at debugging

* Fix more merge conflicts

* Touch up an error message

* Fixup travis again

* Enable all travis tests again

* Test everything on AppVeyor
2018-07-05 09:22:01 -05:00
Marcin Baraniecki
9431037265
Merge pull request #382 from srenatus/sr/js_globals/Proxy
Add bindings for Proxy
2018-07-05 10:20:43 +02:00
Stephan Renatus
06b8d3535d js_globals::Proxy::*: make tests plain JS
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-07-05 09:03:16 +02:00
Jannik Keye
8dd8475000 fix: Reflec.defineProperty no longer returns Result 2018-07-05 08:33:22 +02:00
Stephan Renatus
b704ceeb3a Bindings for Proxy.revocable()
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-07-05 08:04:41 +02:00
Stephan Renatus
2b8e789c9c Bindings for Proxy.new()
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-07-05 08:04:41 +02:00
Alex Crichton
efa4a2b8fa
Speed up Travis by running Webpack in fewer tests (#381)
* Reorganize Travis configuration

* Add a `JOB` env var descriptor to all matrix entries. Not used anywhere but is
  useful when viewing the whole build on Travis's web interface.
* Reorganize where builds are located, moving slow builds first and fast ones
  last.
* Change checking the CLI builds from `cargo build` to `cargo check`
* Use YAML references to reduce some duplication

* Print some more timing statistics for each test

* Extract `Project` helper in tests to a module

This'll help make it a bit more extensible over time. At the same time the
methods are also slightly reorganized to read more clearly from top to bottom.

* Migrate all tests away from Webpack

Wepback can take a significant amount of time to execute and when it's
multiplied by hundreds of tests that adds up really quickly! After investigating
Node's `--experimental-modules` option it looks like it's suitable for our use
so this switches all tests to using JS files (moving away from TypeScript as
well) with `--experimental-modules` with Node.

Tests will be selectively re-enabled with webpack and node.js specific output
(that doesn't require `--experimental-modules`), coming in later commits.

* Restore the node test for node.js output

Ensures it's workable as-is

* Only generate typescript with webpack

* Only read wasm files for webpack

* Skip package.json/node_modules for now

* Only generate webpack config if needed

* Start a dedicated test module for typescript

Will hopefully verify the generated Typescript compiles OK.

* Remove unneeded `node` method

* Fixup some rebase conflicts

* Don't run asmjs example on travis

* Fixup generator tests

* Attempt to fix windows

* Comment windows fix

* More test fixes

* More exclusions

* More test fixes

* Relax eslint regex

Catch mjs modules as well

* Fix eslint

* Speed up travis on examples slightly
2018-07-04 22:37:09 -05:00
Sendil Kumar N
e912b9d2a2
Merge pull request #374 from Hywan/js_test_date_locale
test(js) Fix expectations regarding given locales
2018-07-04 22:25:05 +02:00
Sendil Kumar N
1662668b42
Merge pull request #389 from alexcrichton/fix-unused
Fix some eslint warnings about unused variables
2018-07-04 22:24:03 +02:00
Ivan Enderlin
43de00b347 feat(js) Add ArrayBuffer::new, ::is_view & ::slice bindings. (#388)
* feat(js) Add `ArrayBuffer::new`, `::is_view` & `::slice` bindings.

* fix(js) Fix number units, comments, add `slice_with_end`.

* test(js) Fix a function name.
2018-07-04 13:53:49 -05:00
Corey Farwell
ad72ea54a9 Fix typo in rust-type-conversions.md. (#390) 2018-07-04 13:53:20 -05:00
Alex Crichton
247ea628fb Don't import wasm in generated JS if it's not used
Mostly just an edge case
2018-07-04 08:50:48 -07:00
Alex Crichton
0603faa57a Flag BigInt* arrays defined in eslintrc 2018-07-04 08:36:56 -07:00
Alex Crichton
26ad8c627e Deny unused variables in eslintrc 2018-07-04 08:35:39 -07:00
Alex Crichton
62a6486d5b Reformat eslintrc file 2018-07-04 08:35:26 -07:00
Alex Crichton
000970ee2c Remove extraneous exposure of uint64 memory
No longer needed!
2018-07-04 08:34:19 -07:00
Alex Crichton
67b9ce58aa Fix getArrayJsValueFromWasm exposing wrong function
This needs `getUint32Memory`, not `getArrayU32FromWasm`.
2018-07-04 08:30:18 -07:00
Alex Crichton
3510b20595 Fix a stray unused variable
Travis tests show hundreds of warning for `'y' is defined but never used` and
when investigating it looks like a mistake was introduced in 0938858aa
during #272, so hopefully this'll be an easy fix!
2018-07-04 08:16:09 -07:00
Ivan Enderlin
f5d4751c0b
test(js) Check the types and lightly the data, but not that much.
Because NodeJS can have different i18n behaviors depending of the
version, let's keep things simple. In this case, we want to test the
types,
period. Cf. https://github.com/rustwasm/wasm-bindgen/pull/374#issuecomment-402447333
2018-07-04 16:47:51 +02:00
Jannik Keye
7790b34c07 fix: simplify signatures to avoid Result usage 2018-07-04 16:10:17 +02:00
Jannik Keye
40b7b069bc fix: return actual error message 2018-07-04 15:52:12 +02:00
Ivan Enderlin
c450fbf237
feat(js) Support exception on WebAssembly::validate. 2018-07-04 15:51:55 +02:00
Jannik Keye
008f17143b fix: Reflect.has target should be &Object 2018-07-04 15:32:34 +02:00
Ivan Enderlin
fe25a9a268
feat(js) Implement the WebAssembly.validate binding. 2018-07-04 15:27:01 +02:00
Marcin Baraniecki
2694dd4dee
Merge pull request #385 from toVersus/js_date
bindings for date.getDay/getFullYear
2018-07-04 14:56:22 +02:00
Jannik Keye
3442f9d9d7 fix: Reflect.has 2018-07-04 13:18:06 +02:00
Jannik Keye
1397f9b05a feat: add Reflect.setPrototypeOf 2018-07-04 13:13:35 +02:00
Jannik Keye
eb3f67a36f feat: add Reflect.set 2018-07-04 13:08:43 +02:00
Jannik Keye
fc82ba4ec3 feat: add Reflect.preventExtensions 2018-07-04 12:56:37 +02:00
Jannik Keye
e36f982391 feat: add Reflect.ownKeys 2018-07-04 12:53:38 +02:00
toversus
e95994fd19 bindings for Date.prototype.getFullYear() 2018-07-04 19:52:12 +09:00
Jannik Keye
eb245d5503 feat: add Reflect.isExtensible 2018-07-04 12:49:07 +02:00
Jannik Keye
7c297ccfb4 feat: add Reflect.has 2018-07-04 12:44:49 +02:00
toversus
3007e813ea bindings for Date.prototype.getDay() 2018-07-04 19:41:06 +09:00
Jannik Keye
edddd4b08e feat: add Reflect.getPrototypeOf 2018-07-04 12:39:56 +02:00
Jannik Keye
2422c5e945 feat: add Reflect.getOwnPropertyDescriptor 2018-07-04 12:35:40 +02:00
Jannik Keye
3ba00bc13c feat: add Reflect.get 2018-07-04 12:31:24 +02:00
Jannik Keye
5fa18f8f40 feat: add Reflect.deleteProperty 2018-07-04 12:24:52 +02:00
Jannik Keye
07a726b9dc feat: add Reflect.defineProperty 2018-07-04 12:17:01 +02:00
Jannik Keye
13b3b0d87a feat: add Reflect.construct 2018-07-04 12:07:02 +02:00
Jannik Keye
592d426e4f feat: add Reflect.apply 2018-07-04 11:43:34 +02:00
Nick Fitzgerald
fbbd97bbe0
Merge pull request #380 from akryvomaz/master
bindings for Generator.next(), Generator.return() and Generator.throw()
2018-07-03 16:30:46 -07:00
Alexander Kryvomaz
eac2b05b1b added catch attribute to the Generator methods, consistent rust keyword name 2018-07-04 01:22:56 +03:00
Marcin Baraniecki
3092beb4e4 fixes team members table layout (#379) 2018-07-03 16:55:22 -05:00
Nick Fitzgerald
e644ee6dad
Merge pull request #375 from sendilkumarn/fix-node-webpack
fix webpack to handle node global functions
2018-07-03 13:50:39 -07:00
Alexander Kryvomaz
b797bbc39c bindings for Generator.throw() 2018-07-03 23:48:54 +03:00
Alexander Kryvomaz
39d79eb037 bindings for Generator.return() 2018-07-03 23:47:10 +03:00