I guess "it" is an abbreviation of a phrase. But I don't know what it is. Each time when I see this function I always try to find out its meaning.
Can somebody tell me about this?
Specs are defined by calling the global Jasmine function it, which, like describe takes a string and a function. The string is the title of the spec and the function is the spec, or test. A spec contains one or more expectations that test the state of the code.
The name Jasmine is of Persian origin, meaning ”gift from God." It is derived from the Persian word ”yasmin,” referring to the plant, meaning "fragrant flower." Origin: Jasmine is a Persian name meaning "gift from God" or "fragrant flower." Gender: Jasmine is commonly used as a girl name.
describe breaks your test suite into components. Depending on your test strategy, you might have a describe for each function in your class, each module of your plugin, or each user-facing piece of functionality. You can also nest describes to further subdivide the suite.
For initializing and cleaning your specs, Jasmine provides two global functions, beforeEach() and afterEach() : The beforeEach function is called once before each spec in the suite where it is called. The afterEach function is called once after each spec in the suite where it's called.
it('is really much more simple than you think)
The it()
syntax it is used to tell Jasmine what it('should happen in your test')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With