Skip to content

Lab 22 jonny#37

Open
jonathanheemstra wants to merge 35 commits intocodefellows-seattle-javascript-401d12:masterfrom
jonathanheemstra:Lab-22-Jonny
Open

Lab 22 jonny#37
jonathanheemstra wants to merge 35 commits intocodefellows-seattle-javascript-401d12:masterfrom
jonathanheemstra:Lab-22-Jonny

Conversation

@jonathanheemstra
Copy link
Copy Markdown

Question:
I tried to abstract out some of the test setup into before statements, specifically I attempted to abstract out setting up variables like let expected = cowsay.say({ text: 'testing', f: this.cowsayCtrl.current }); so that I could repeatably call them in various tests but I got errors saying the variable didn't exist even though I used fat arrow functions and I assumed the test would have access to the variable. Does angular mocks provide some kind of scoping that is not readily apparent?

Observation:
Using a mocking library like angular mocks library really helps with making testing in angular much easier and abstracts out quite a bit of the overhead in setting up testing.

scaffold files and set up package.json
added karma.conf file and updated package.json
Comment thread package.json
"jasmine-core": "^2.5.2",
"karma": "^1.4.0",
"karma-jasmine": "^1.1.0",
"karma-mocha-reporter": "^2.2.1",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Way to add this to make the tests more readable when you run them in the terminal!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants