Commit Graph

22 Commits

Author SHA1 Message Date
Neil Fraser
5a64a9a7f7 fix: Fix the compiler test, and check if it worked. (#6638)
* Add tsick.js to rewrite enums.

tsc generates JavaScript which is incompatible with the Closure Compiler's advanced optimizations.

* Remove unused 'outputCode' variable.

* Rename 'run_X_in_browser.js' to 'webdriver.js'

The Mocha and generator tests can both be run either manually or via our webdriver.  In all cases they run in a browser.  These two 'run_X_in_browser.js' files only apply to webdriver, thus they are confusingly named.

Also delete completely unused (and broken) `run_all_tests.sh`

* Linting improvements to mocha/webdriver.js

Still not at 100%.  Complains about require/module/process/__dirname not being defined in multiple places.

* runTestBlock -> runTestFunction

'Block' means something very different in Blockly.

* Removal of `var` from scripts.

* Add webdriver test to verify compile test worked.

* Resolve conficts with 'develop'.

* Address PR comments.
2022-11-25 11:45:00 -08:00
Maribeth Bottorff
49f87fba79 chore: enable linting ts files (#6351)
* chore: initial setup for linting ts

* chore: Temporarily disable most of the rules causing problems

* chore: fix autofixable problems.

* chore: ignore the last few files and rules

* chore: fix remaining lint errors

* chore: fix more small lint

* chore: run original rules on js files, new ts rules on ts files

* chore: use jsdoc style return in js files

* chore: add lint fix script

* chore: fix prefer-spread lint

* chore: fix no-invalid-this rule

* chore: fix no-unused-vars

* chore: fix trashcan lint
2022-08-16 13:59:15 -07:00
Christopher Allen
00a75ca048 refactor: Be more selective in eslint ignorance (#5955)
Rather than ignoring blockly_uncompressed.js, gulpfile.js and
core/utils/global.js entirely, add suitable eslint-disable directives
to those files so that they lint cleanly (and migrate gulpfile to
use const instead of var).
2022-02-23 22:12:15 +00:00
Rachel Fenichel
d11cc047a4 chore: fix more lint (#5700)
* chore: fix 918 violations of comma-dangle rule

* chore: fix 2 violations of comma-spacing

* chore: fix 13 violations of padded-blocks

* chore: fix 50 violations of block-spacing

* chore: fix one violation of semi-spacing

* chore: fix 4 violations of space-before-blocks

* chore: fix 38 violations of object-curly-spacing

* chore: fix 30 violations of key-spacing

* chore: fix 3 violations of quote-props

* chore: fix 5 violations of arrow-parens

* chore: fix 8 violations of no-tabs

* chore: allow uncommented helper functions in mocha tests

* chore: fix several more lint errors

* chore: tweak eslint configuration in core and tests

* chore: rebuild for tests
2021-11-10 10:18:36 -08:00
Christopher Allen
d313ec804a Merge branch 'develop' into goog.module-prep
This resolves a conflict in `blockly_uncompressed.js`, and missing
updates to `test/deps.js`, caused by PR #5041.
2021-07-13 22:16:35 +01:00
Christopher Allen
7d306f4089 Don't lint build output
npm test has been failing if previous build output was present,
because the generated build/msg/??.msg files are missing a trailing
newline and the line to exclude build/* from being linted was
inadvertently omitted from commit 9e72378.

(Much of the rest of the build output would also fail lint checks but
was already excluded by the *_compressed*.js exclusion.)
2021-07-13 16:11:54 +01:00
Christopher Allen
f5a9f2cf2b Load dependency graph from tests/deps.js in uncompiled mode
* New gulp task buildDeps (npm run build:deps) to create tests/deps.js.
* Old gulp task buildUncompressed is deleted.
* blockly_uncompressed.js is now handwritten.
  * And simplified; in particular, BLOCKLY_BOOT is gone.
  * And linted!
* For consistency with the Closure documentation and base.js,
  consistently refer to what blockly_uncompressed.js is used for as
  "uncompiled mode" rather than "uncompressed mode" (but don't yet
  rename it to blockly_uncompiled.js)
2021-07-12 02:28:09 +01:00
Sam El-Husseini
43c2a0e85c Add sourcemaps (#3872)
* Update build scripts to produce source maps
2020-05-01 10:10:23 -07:00
Sam El-Husseini
21763b7e00 Support enabling start hats from themes (#3722)
* Support themes configuring the start hats of blocks. Add test themes
2020-03-05 17:34:31 -08:00
Rachel Fenichel
e78a87a1e5 Break gulpfile into multiple subfiles 2020-02-14 13:42:38 -08:00
Sam El-Husseini
6a771a8636 Remove old node module, update tests to use the npm one. (#3111) 2019-09-27 10:32:52 -07:00
Neil Fraser
75cf614104 Break CSS into modules. (#3084)
* Break CSS into modules.

Drops the compile test by 3 KB.
Remove obsolete .blocklyDraggable class stub (it used to be dynamically changed).
Remove unused menuseparator CSS.
2019-09-25 18:01:19 -07:00
Sam El-Husseini
99c624db34 Fix Blockly.utils.global when wrapped in a module. (#3035)
* Fix Blockly.utils.global when wrapped in a module.
2019-09-17 14:07:03 -07:00
Sam El-Husseini
4deb166007 Remove closure from the build script and blockly_uncompressed (#2891)
* Remove closure from the build script and blockly_uncompressed.
2019-08-22 11:22:55 -07:00
Rachel Fenichel
9a7e738d8b spelling and lint (ignore) 2019-07-22 15:59:55 -07:00
Rachel Fenichel
e77efa6c13 Add mocha tests + parsing to npm test 2019-05-01 13:43:19 -07:00
Andrew n marshall
7886d24130 Fixing xml.js: Always throw XML I/O errors; Support parsing in Node (#1911)
* Improved Blockly.XML comments.
 * Support JSDOM as an alternate parser under Node.js
 * Throw standard errors instead of goog.asserts.
 * Adding textToDomDocument_ and override in gulpfile.
2018-06-12 14:03:10 -07:00
Andrew n marshall
2e8c29de45 Adding gulpfile to build Node.js compatible library. (#1847)
The gulp file is derived from work in PR #887, with numerous
refinements and clarifying comments.

Also updating the version number in package.json, including the
'develop' prerelease tag for the develop branch.
2018-05-11 15:19:47 -07:00
Andrew n marshall
0ffd5dda18 Changing root script for tests under Node. (#1837)
* Changing root script for tests under Node.

Was: tests/jsunit/test_runner.js
Now: tests/test_runner.js

The webdriver & jsunit calls formerly in tests/jsunit/test_runner.js
are now in function runJsUnitTestsInBrowser, in
run_jsunit_tests_in_browser.js, called from tests/test_runner.js.

This makes room for additional tests under Node, such as headless and generator tests.
2018-05-02 12:19:49 -07:00
Rachel Fenichel
078932a652 ignore more types of tests 2017-11-10 14:16:47 -08:00
Rachel Fenichel
f4b7a8851f Eslint ignore svg-externs.js 2017-11-10 14:16:47 -08:00
Rachel Fenichel
4841f136f1 More lint and eslint configuration. 2016-05-25 15:35:11 -07:00