Commit graph

8906 commits

Author SHA1 Message Date
Tom Najdek
e86bbfbda0 Tweak test runner to work in MSYS environment on Windows 2017-06-06 00:36:03 -04:00
Tom Najdek
e207124f88 On Windows, copy files instead of symlinking 2017-06-06 00:36:03 -04:00
Tom Najdek
c335099465 Add support for glob in babel-worker ignored paths
* Also fixes an issue with handling paths on Windows
2017-06-06 00:35:59 -04:00
Tom Najdek
f98ccdee46 Ensure build process exits with non-zero result on failure
* During build, error is printed out with stack and process exits
* During development, initial build behaves as above, however when
  watching files, errors are displayed but watch process does not
  exit allowing fixes without a complete rebuild.
2017-06-05 11:41:10 +01:00
Dan Stillman
b79ecfb5fe Temporarily disable test for non-integer getAsync() 2017-06-05 03:00:15 -04:00
Dan Stillman
71d636e8fb Make non-integer id passed to getAsync() non-fatal for now
Follow-up to 4e1937680f
2017-06-04 21:35:54 -04:00
Dan Stillman
653f041140 Fix report generation after 4e1937680f 2017-06-04 21:33:14 -04:00
Dan Stillman
47f7f3a93f Fix logging of unhandled promise rejections 2017-06-02 10:37:40 -04:00
Dan Stillman
4b0e2a9554 Fix separate note window (regression from 4e1937680f) 2017-06-02 10:36:44 -04:00
Dan Stillman
898a1dc679 Add alternative to padStart for test in Fx45 2017-06-01 16:44:11 -04:00
Dan Stillman
53842adefc Add explicit npm i
(Travis might call this automatically before 'script', but we need it
before 'gulp build', and we don't want to do 'gulp build' in 'script',
because the output isn't relevant and if it fails there's no need to run
the tests.)
2017-06-01 16:11:03 -04:00
Dan Stillman
595ab592aa Use Node.js mode on Travis 2017-06-01 16:03:32 -04:00
Dan Stillman
140217d0fe Fix Firefox 54 download on Travis 2017-06-01 15:47:06 -04:00
Dan Stillman
201af23484 Remove sinon-as-promised from package.json 2017-06-01 15:44:25 -04:00
Dan Stillman
6c9f3864e7 Switch to Firefox 54 Beta on Travis 2017-06-01 15:39:43 -04:00
Dan Stillman
d889d26394 Run build step before running tests on Travis 2017-06-01 15:39:43 -04:00
Dan Stillman
05ff16c17f Fix some breakage from 013dc958b3 2017-06-01 15:39:42 -04:00
Dan Stillman
ede03f4366 Update some Sinon reset() calls
In Sinon 2, reset() now resets both behavior and history, so if a stub
specifies behavior and we want to use it again, we have to call
resetHistory().
2017-06-01 15:39:42 -04:00
Dan Stillman
522391bc3e Enable retainLines in Babel config
Addresses #1235 (maybe sufficiently, depending on how much we care about
wacky code in the builds)
2017-06-01 15:39:42 -04:00
Dan Stillman
04db119ae8 Merge pull request #1239 from tnajdek/master
Enable running tests against babelized code in build/dir
2017-06-01 15:38:26 -04:00
Tom Najdek
a59b78e59e Tweak test syntax that breaks with current version of chai-as-promised
* Second parameter should be an optional message, however is treated
  as a string that should be contained in the error message
2017-06-01 11:36:18 -04:00
Tom Najdek
4ec6925220 Remove "Error:" expected in error messages.
* "Error:" seems to have been injected into the message by Bluebird,
  but that's no longer the case
2017-06-01 11:36:18 -04:00
Tom Najdek
063e13ef22 Modernize sinon.stub() calls 2017-06-01 11:36:17 -04:00
Tom Najdek
506b35840e Add a shutdown hook in Zotero.Prefs to unregister observer
* Without this, preference change observers stack, triggering multiple
  times if Zotero is re-initialized multiple times within the same
  browser instance (like in tests)
2017-06-01 11:36:17 -04:00
Tom Najdek
aa6037c088 Re-introduce custom implementation of setTimeout
* Resolves issues with some tests failing
2017-06-01 11:36:17 -04:00
Tom Najdek
289b049377 Support generators in tests via coMocha, instead of custom code
* coMocha offers better error stack trace
2017-06-01 11:36:17 -04:00
Tom Najdek
14bf3184bb Fixes and tweaks to make tests work with babelized code
* Use mocha, chai & sinon from the npm. As of sinon 2.0
  sinon-as-promised is no longer required so it is removed
* Tweak code to re-use the same loader with the same environment
  throghout the code
* Introduce browserify step for testing tools that only provide
  node-compatible libraries (sinon, chai-as-promised)
* Introduce copy step for test data to resolve multiple issues with
  tests depending on files not being symlinks
* Re-introduce custom implementation of setTimeout to resolve issues
  with few tests
* Re-introduce custom Bluebird Promises config & monkey patch
2017-06-01 11:36:16 -04:00
Dan Stillman
748c30206f Run tests from build dir 2017-06-01 11:36:16 -04:00
Dan Stillman
a55852ea1c Log Zotero.alert() calls to the terminal 2017-05-31 00:43:57 -04:00
Dan Stillman
61452a835b Fix auto-restore of automatic backup on DB corruption error 2017-05-31 00:43:57 -04:00
Dan Stillman
013dc958b3 Restore cleaner error and item-selection button for note-too-long error 2017-05-31 00:10:00 -04:00
Dan Stillman
5d16352f57 Don't show "Remove Item from Collection" for child items
Test forthcoming once tests are working again
2017-05-27 18:38:28 -04:00
Dan Stillman
aa05920117 Don't break getLocaleCollation() in Firefox <54 (after a73b2403b) 2017-05-27 05:38:29 -04:00
Dan Stillman
d6c36ae9a3 Update help URLs and move to config file 2017-05-27 05:32:01 -04:00
Dan Stillman
a73b2403b0 Fix getLocaleCollation() in Firefox 54 2017-05-27 05:32:01 -04:00
Dan Stillman
d5a8a3420d Additional locale service updates for Firefox 54 compatibility
Follow-up to 0ac37ab65a
2017-05-26 01:37:54 -04:00
Dan Stillman
7fc188b172 Fix crashing for some actions in duplicate items
Necessary after more strict error handling in c4411e1ad3
2017-05-24 18:24:26 -04:00
Dan Stillman
8f116f60c4 Increase gulp.watch() interval to decrease CPU usage
This brings idle CPU usage down to 1.5% from 14% for me.
2017-05-24 18:24:26 -04:00
Dan Stillman
8bc76dd2db Restore logging of unhandled errors from Bluebird (since 9aa057edee) 2017-05-24 18:24:26 -04:00
Dan Stillman
1e459287de Convert non-standard octal escape sequences to hex in test runner 2017-05-24 01:59:56 -04:00
Dan Stillman
aa321f3495 Add example async/await to test Babel transform 2017-05-24 00:59:45 -04:00
Dan Stillman
6afc58a629 Move require() into ZoteroContext and fix Bluebird module path 2017-05-24 00:58:41 -04:00
Dan Stillman
319edae7f2 Update citeproc-js to 1.1.169 2017-05-23 17:39:10 -04:00
Dan Stillman
79ed9e8448 Display relative path to files in build output
Not just filenames
2017-05-23 17:25:53 -04:00
Dan Stillman
9cd0c5a674 Merge pull request #1230 from tnajdek/babel
Introduce a build system
2017-05-23 17:00:33 -04:00
Tom Najdek
9aa057edee Introduce a build system
* Add a multi-process, gulp-based build system to support es6 features,
  async/await, jsx and scss
* Add a package.json to support dependency management and allow starting
  the build process via npm
* Replace embedded Bluebird library with npm-installed one
* Add react, react-dom and web-library
* Introduce a custom require() loader in include.js as well as a minimal
  local require() implementation in various other places
2017-05-23 17:02:50 +01:00
Dan Stillman
c0f7f6070a Avoid a warning from a storageRequest test from the item not existing 2017-05-23 02:12:00 -04:00
Dan Stillman
e1fb28faa9 Convert some object ids from strings to integers after 4e1937680 2017-05-23 02:10:26 -04:00
Dan Stillman
4e1937680f Throw error if non-number is passed to Zotero.DataObjects.getAsync()
Previously, if an id was psased as a string and the id existed in the
cache, an error wouldn't be thrown, but if there id wasn't in the cache
(e.g., because it was in an unloaded library) it would. This requires an
integer in all cases.

Note that, among other things, any code that gets ids from object keys
will need to convert them to integers before passing to getAsync().
2017-05-23 02:04:58 -04:00
Dan Stillman
265df6d48c Skip edit check if skipAll is passed to object save 2017-05-22 17:29:56 -04:00