Frontier Software

Robert Laing's programing notes

JSDoc

By Robert Laing

JSDoc

Command line arguments

jsdoc -d doc -R README.md -r .

BDD

Test Driven Development vs Behavior Driven Development

https://cucumber.io/docs/guides/overview/

Given-When-Then

Jasmine

From Jasmine’s github page, you only need to download jasmine-standalone-{*.*.*}.zip which creates a directly like so

├── lib
│   └── jasmine-3.7.1
│       ├── boot.js
│       ├── jasmine.css
│       ├── jasmine_favicon.png
│       ├── jasmine-html.js
│       └── jasmine.js
├── MIT.LICENSE
├── spec
│   ├── PlayerSpec.js
│   └── SpecHelper.js
├── SpecRunner.html
└── src
    ├── Player.js
    └── Song.js

In my webapps, I create a subdictory in project root called tests which I copy the *.js in lib to. SpecRunner.html and the files in spec and src are examples to use as a template. The equivalent of SpecRunner.html, PlayerSpec.js, and SpecHelper.js I keep in the tests subdirectory.

Jasmine uses a similar vocabulary to Ruby’s RSpec

https://jasmine.github.io/tutorials/your_first_suite

Suites: describe

describe(description, specDefinitions)

describe blocks can be nested within describe blocks.

description

specDefinitions

function() {
...
  it(description, testFunction, timeout)
...
}

testFunction

Specifications: it

it(description, testFunction, timeout)

Expectations

Last updated on 6 Jan 2021
Published on 6 Jan 2021

Content Footer