Commit Graph

45 Commits

Author SHA1 Message Date
Oliver Eyton-Williams
9be2fb9a10 fix: use lodash-es in the client (#41931) 2021-04-28 16:11:20 -05:00
Evgeny Klimenchenko
db369fbed1 fix(client): remove JS comments from user code for tests (#41873)
* Removes comments in js challanges by default

* fix local-scope-and-functions test regex

* fix all languages

* revert language changes

* removed unnecessary removeJSComments from challenges

* fix challanges in other languages

* removed removeJSComments from all challanges
2021-04-28 10:18:54 -05:00
Mrugesh Mohapatra
6c91f81b0e chore(deps): upgrade eslint, prettier & related packages 2021-03-11 12:19:42 +05:30
Shaun Hamilton
ab83d698f9 fix(client): give useful error in solutionform (#40225) 2021-02-01 19:04:04 +05:30
Tom
3978c6be28 feat: i18n user interface (#40306)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-01-31 12:15:32 +05:30
Oliver Eyton-Williams
de55527693 fix: prevent preview-tests race condition (#39286) 2020-07-20 08:33:56 -07:00
Oliver Eyton-Williams
c6eb40ceef feat: remove protection from interview prep (#38136)
The interview prep section includes many challenges that require long
running calculations which can be mistaken for infinite loops. This
removes the loop protection from those challenges, while the tests are
being evaluated.

It keeps the protection for the preview, since it is easy to create
broken code while working on a challenge and that should not crash the
site.
2020-02-04 10:33:56 +05:30
vanya829
d626e898ee fix(curriculum): stop tests running after navigating away (#38146) 2020-02-03 18:52:49 +05:30
Oliver Eyton-Williams
f5feff386a fix: stop user code after 500ms of execution
Code like `var xs = []; while(true){ xs.push(1) }` can quickly run the
browser out of memory causing it to crash.  These changes stop user loops
from running indefinitely so that common mistakes will no longer cause
the browser to crash.

Also, the user is informed if a long running loop is detected (js and
jsx challenges) during preview or testing.  Before this there was no
protection for js challenges and no information was given to the
user if they had created such a loop.

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>
Co-Authored-By: mrugesh <1884376+raisedadead@users.noreply.github.com>
Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
2020-01-03 11:41:52 +05:30
Oliver Eyton-Williams
e5abfa15ad Revert "fix: stop user code after 100ms of execution" (#37965)
This reverts commit 01b37f664f.
2019-12-21 11:09:32 +05:30
Oliver Eyton-Williams
01b37f664f fix: stop user code after 100ms of execution (#37841)
Co-authored-by: mrugesh <1884376+raisedadead@users.noreply.github.com>
Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2019-12-20 19:28:17 +05:30
Oliver Eyton-Williams
febba792e7 fix: allow log in testString, restrict test errors
Console logs from testString get reported and test errors are sent to
the dev console (JS).

challenge building is only attempted if there is a build function to do
so.

Various functions have been renamed to better reflect what they do.
2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
9194b7731b fix: simplify logging and include console.log
This comes at the cost of creating a flash of the default message when
the preview updates, but significantly simplifies the code.
2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
beecb04c1a fix: report errors thrown after the frame is ready
Certain challenges involve code that is not run until the user
interacts with the preview (typically via a click listener). This uses
consoleProxy to report those errors.

Error logging has been simplified, reducing the number of places errors
can be reported from.

Some of the redux-saga code has been renamed in an attempt to improve
clarity.
2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
04d2de96df fix: conditionally log non-assertion errors (JS)
console.logs and errors are only reported during the first evaluation of
the user's code.  This is because the code is evaluated for each test,
but the logs will not change between the build phases of the tests.

Errors thrown during testing (except failing assertions) are always
reported. This is to inform the user that their code is faulty, rather
than that it does not meet the challenge's requirements.
2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
64fcbbb491 fix: output console.logs as user types (JS) 2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
29641986ab fix: output console.logs as user types (DOM)
Any console.logs inside script tags will be written to the fcc console
as the user types.  DOM challenges only.

Also, DRYed out the main and test frame creation.
2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
5059d23600 fix: report all build errors to the fcc console
Previously only challenges with previews would inform the user of syntax
errors.  This extends that to all challenges and corrects the output
format so errors are clearer.
2019-11-19 22:23:57 +05:30
Oliver Eyton-Williams
c6a11dd50a fix: escape HTML entities in code editor log (#37601) 2019-10-31 17:56:10 +05:30
ValeraS
08403ca561 chore(client): update redux-saga 2019-06-12 02:49:29 +05:30
Oliver Eyton-Williams
60dd7ca703 fix: Change test output formatting from code to html (#35857) 2019-06-09 05:28:10 +05:30
Steven Failla
43a4fa8cb0 fix(client): reset test results before execution (#36029)
* fixed issue where tests should fail when code has error

Signed-off-by: Stevo99 <Sfailla1983@gmail.com>

* fix(client): Initialize tests as failing in case of build errors

* fix: Reset tests to initial state when build fails

* fix: simplify expression
2019-05-27 00:00:12 +03:00
Valeriy S
4c252654a4 fix(client): refactor a challenge preview saga 2019-02-16 17:48:37 +00:00
Valeriy S
98f979f3b4 fix(client): disable build on error 2019-02-16 17:48:37 +00:00
Valeriy
dd41028f5b fix(client): replace decodeHTMLEntities to entities package 2019-01-28 12:02:45 +00:00
Valeriy S
3d008c69d7 fix(learn): on user code execution error, run tests anyway 2019-01-16 10:45:39 +00:00
Valeriy
00a1d25fbb feat(learn): lazy load Enzyme in the test frame 2019-01-16 10:45:39 +00:00
Valeriy S
b6e24d4e14 fix(client): add debounce time for a preview 2019-01-14 13:44:54 +00:00
Valeriy
7bfc733da6 fix(client): remove a dependency on the store from build challenges 2019-01-14 13:44:54 +00:00
Valeriy
d263ed4ed7 fix: use document from store context 2019-01-14 13:44:54 +00:00
Valeriy
b59c7cfed0 fix: remove state dependency from frame creation 2019-01-14 13:44:54 +00:00
Valeriy
dcca74ab92 fix: use factory method to create worker executor 2019-01-14 13:44:54 +00:00
Valeriy S
2168b61151 fix: unify build of challenges 2019-01-14 13:44:54 +00:00
Valeriy S
2297881f91 fix: pass proxyLogger to params 2019-01-14 13:44:54 +00:00
Valeriy S
3654f2a971 fix(client): wait for a ready event in jQuery challenges 2019-01-14 13:44:54 +00:00
Valeriy S
7df4d06056 fix(client): refactor a test runner 2019-01-14 13:44:54 +00:00
Valeriy S
de7798c753 fix(client): use proxy logger in test worker 2019-01-14 13:44:54 +00:00
Valeriy S
c43dfe1eb7 feat(client): execute backend challenge saga 2019-01-14 13:44:54 +00:00
Valeriy S
6d7744646d feat(client): extract common tests execution logic 2019-01-14 13:44:54 +00:00
Valeriy S
0775766702 fix(client): log to console saga 2019-01-14 13:44:54 +00:00
Valeriy
a50a048ee7 feat(client): execute DOM challenge saga 2019-01-14 13:44:54 +00:00
Valeriy S
0a7ac8935e fix: extract a test updating logic and logging 2018-12-06 13:05:09 +00:00
Valeriy S
779d2034f3 fix: perform the latest run and cancel previous 2018-12-06 13:05:09 +00:00
Valeriy S
8a6611db3a fix: use common saga to execute challenges 2018-12-06 13:05:09 +00:00
Valeriy
a4fd935b8b feat: execute js challenges saga 2018-12-06 13:05:09 +00:00