From db958ff8d7cc04655b9fa9c41e8f38d3f047f698 Mon Sep 17 00:00:00 2001 From: octopusinvitro Date: Mon, 27 Mar 2017 23:20:40 +0100 Subject: [PATCH 1/6] Tema 2.start-here. Add jasmine to env in eslint This change adds jasmine to the env rule in the eslint config file. This is done so that tests don't get false positives for Jasmine-reserved words like "describe", "it", etc. --- es/02-javascript/02-practica/start-here/.eslintrc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/es/02-javascript/02-practica/start-here/.eslintrc.json b/es/02-javascript/02-practica/start-here/.eslintrc.json index 17ed149..78ba4fe 100644 --- a/es/02-javascript/02-practica/start-here/.eslintrc.json +++ b/es/02-javascript/02-practica/start-here/.eslintrc.json @@ -1,6 +1,7 @@ { "env": { - "node": true + "node": true, + "jasmine": true }, "extends": "eslint:recommended", "rules": { From a1968dbb5cead91b36a575c2238da492eaff5689 Mon Sep 17 00:00:00 2001 From: octopusinvitro Date: Mon, 27 Mar 2017 23:24:29 +0100 Subject: [PATCH 2/6] Tema 2.start-here. Correct the test description It was describing the previous test. --- es/02-javascript/02-practica/start-here/spec/TurnList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/es/02-javascript/02-practica/start-here/spec/TurnList.js b/es/02-javascript/02-practica/start-here/spec/TurnList.js index d02d2fe..fcbfe97 100644 --- a/es/02-javascript/02-practica/start-here/spec/TurnList.js +++ b/es/02-javascript/02-practica/start-here/spec/TurnList.js @@ -25,13 +25,13 @@ xdescribe('The TurnList type', function () { turnList.reset(characters); }); - it('accepts a set of characters and sort them by inititative.', function () { + it('accepts a set of characters and sorts them by inititative.', function () { expect(turnList.turnNumber).toBe(0); expect(turnList.activeCharacterId).toBe(null); expect(turnList.list).toEqual(['c', 'b', 'a']); }); - it('accepts a set of characters and sort them by inititative.', function () { + it('can play the next turn.', function () { var turn = turnList.next(); expect(turn.number).toBe(1); From f6d0cefc90c899aa1197b7a56ffd91dbba832590 Mon Sep 17 00:00:00 2001 From: octopusinvitro Date: Mon, 27 Mar 2017 23:59:41 +0100 Subject: [PATCH 3/6] Tema 2.start-here. Correct typos in the entities tests --- es/02-javascript/02-practica/start-here/spec/entities.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/es/02-javascript/02-practica/start-here/spec/entities.js b/es/02-javascript/02-practica/start-here/spec/entities.js index fff81e5..91c2bbe 100644 --- a/es/02-javascript/02-practica/start-here/spec/entities.js +++ b/es/02-javascript/02-practica/start-here/spec/entities.js @@ -46,7 +46,7 @@ describe('Entities library', function () { xdescribe('Effect type', function () { - it('allows specify arbitrary feature alterations.', function () { + it('allows to specify arbitrary feature alterations.', function () { var effect = new Effect({ hp: 5, mp: -5 @@ -160,7 +160,7 @@ describe('Entities library', function () { }); }); - it('does not applie an effect if the effect comes from a foe but ' + + it('does not apply an effect if the effect comes from a foe but ' + 'defense roll passed.', function () { var isAlly = false; From 2d8b0c36423e915d426dd06af41b69ce1ab55204 Mon Sep 17 00:00:00 2001 From: octopusinvitro Date: Mon, 27 Mar 2017 23:59:41 +0100 Subject: [PATCH 4/6] Tema 2.start-here. Correct small typo in the CharacterView's tests --- es/02-javascript/02-practica/start-here/spec/CharacterView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es/02-javascript/02-practica/start-here/spec/CharacterView.js b/es/02-javascript/02-practica/start-here/spec/CharacterView.js index 34b140a..3bd9571 100644 --- a/es/02-javascript/02-practica/start-here/spec/CharacterView.js +++ b/es/02-javascript/02-practica/start-here/spec/CharacterView.js @@ -1,6 +1,6 @@ var samples = require('./samplelib'); -xdescribe('CharactesView type', function () { +xdescribe('CharactersView type', function () { 'use strict'; var CharactersView = require('../src/CharactersView'); From a4c041f39d903245ffd1f93cade055490c4c2749 Mon Sep 17 00:00:00 2001 From: octopusinvitro Date: Mon, 27 Mar 2017 23:59:41 +0100 Subject: [PATCH 5/6] Tema 2.start-here. Correct small typo in the OptionsStack's tests --- es/02-javascript/02-practica/start-here/spec/OptionsStack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es/02-javascript/02-practica/start-here/spec/OptionsStack.js b/es/02-javascript/02-practica/start-here/spec/OptionsStack.js index 3b17b08..d3df065 100644 --- a/es/02-javascript/02-practica/start-here/spec/OptionsStack.js +++ b/es/02-javascript/02-practica/start-here/spec/OptionsStack.js @@ -39,7 +39,7 @@ xdescribe('OptionsStack type', function () { expect(optionsStack.current).toBe(group); }); - it('adds an options group by assigning a object to current.', function () { + it('adds an options group by assigning an object to current.', function () { var group = { a: 1, b: 2}; optionsStack.current = group; expect(MockOptions).toHaveBeenCalledWith(group); From be313f4e8f624220177c5377a0cad98bd1aa1aa7 Mon Sep 17 00:00:00 2001 From: octopusinvitro Date: Mon, 27 Mar 2017 23:59:41 +0100 Subject: [PATCH 6/6] Tema 2.start-here. Reword test description Since the word test can have a very specific meaning, it may be better to reword this test description. Also, the presence of two "can" may read a bit repetitive. --- es/02-javascript/02-practica/start-here/spec/entities.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es/02-javascript/02-practica/start-here/spec/entities.js b/es/02-javascript/02-practica/start-here/spec/entities.js index 91c2bbe..94973fe 100644 --- a/es/02-javascript/02-practica/start-here/spec/entities.js +++ b/es/02-javascript/02-practica/start-here/spec/entities.js @@ -255,7 +255,7 @@ describe('Entities library', function () { expect(health.effect).toEqual(jasmine.any(Effect)); }); - xit('can test if a character can pay its cost.', function () { + xit('knows if a character can pay its cost.', function () { var health = new Scroll('health', 5, new Effect({ hp: 5 })); expect(health.canBeUsed(10)).toBe(true); expect(health.canBeUsed(4)).toBe(false);