Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task1 4 #81

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Brest Rolling Scopes](http://brest.rollingscopes.com/images/logo_rs_text.svg)](http://brest.rollingscopes.com/)
#Brest Rolling Scopes School
## Javascript Assignments [![Build Status](https://travis-ci.org/rolling-scopes-school/js-assignments.svg?branch=master)](https://travis-ci.org/rolling-scopes-school/js-assignments)
## Javascript Assignments [![Build Status](https://travis-ci.org/AisBrestEDU/js-assignments.svg?branch=master)](https://travis-ci.org/AisBrestEDU/js-assignments)

Yet another javascript assignments. There are a lot of interactive javascript resources for beginners, but most of them are online and do not cover the modern programming workflow. There are some excellent training resources on github (https://github.com/rmurphey/js-assessment, https://github.com/mrdavidlaing/javascript-koans, https://github.com/vasanthk/js-bits etc) but they are not exactly simulate the everyday programming process. So the motivation of this project is to show TDD process in the wild to the beginners. Assingment tests are implemented in various ways to feel a difference and gain the experience what manner is good, what is bad and what is ugly.

Expand Down Expand Up @@ -29,7 +29,7 @@ To start javascript assignments please follow the next steps:
git commit -m "Update the links"
git push origin master
```
* Open https://github.com/rolling-scopes-school/js-assignments and test the build icon. Now it will run all tests and update status once you push changes to github. Keep this icon green!
* Open https://github.com/Valeryia7719/js-assignments and test the build icon. Now it will run all tests and update status once you push changes to github. Keep this icon green!


### How to setup work environment
Expand Down Expand Up @@ -73,7 +73,7 @@ and run the unit tests again. Find one test failed (red). Now it's time to fix i
* Implement the function by any way and verify your solution by running tests until the failed test become passed (green).
* Your solution work, but now time to refactor it. Try to make your code as pretty and simple as possible keeping up the test green.
* Once you can't improve your code and tests are passed you can commit your solution.
* Push your updates to github server and check if tests passed on [travis-ci](https://travis-ci.org/rolling-scopes-school/js-assignments/builds).
* Push your updates to github server and check if tests passed on [travis-ci](https://travis-ci.org/Valeryia7719/js-assignments/builds).
* If everything is OK you can try to resolve the next task.

### How to debug tasks
Expand Down
19 changes: 13 additions & 6 deletions extensions/it-optional.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@
exports = module.exports = testOptional;

function testOptional(title, fn) {

it(title, function() {
try {
fn.call(this);
} catch (err) {
if (err.message=="Not implemented") {

it(title, function () {
let errHandler = (err) => {
if (err.message == "Not implemented") {
this.test.skip();
} else {
throw err;
}
};

try {
let promise = fn.call(this);
if (promise && promise.catch) {
return promise.catch(errHandler);
}
} catch (err) {
errHandler(err);
}
});

Expand Down
Empty file added npm
Empty file.
Loading