![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
literate-jasmine
Advanced tools
var PI;
PI = 22/7;
var a = 1,
b = 2;
expect(a + b).toBe(3);
var a = 6,
b = 2;
And a comment here doesn't break things:
expect(a/b).toBe(3);
Note that we reference the variable PI below that is defined in the code block at the top of this describe (so right under "Mathematics").
var circumference = function(radius) {
return 2 * PI * radius;
};
expect(circumference(5)).toBe(2 * 22/7 * 5);
var text = "abc";
expect(text + "d").toBe("abcd");
setTimeout(function() {
expect(true).toBe(true);
done();
}, 50);
The file you are currently reading has a markdown structure (which includes the main header above and the other parts below) that is parsed into a tree:
Which is then uses the Jasmine describe
, it
and beforeEach
to setup the
tests and then run them.
Note that there is a convention -- a hard rule that there will be a top header (top describe), one or more headers below that (describes) and one or more header below each of those (it blocks).*
This hard limitation makes sense:
literate-jasmine README.md
(If you're working on this project, run ./bin/literate-jasmine
instead.)
Take a close look at how scope works for globals. In the Mathematics section below, we
reference PI
to reset it as a beforeEach
so every test has PI
reset to the correct
value. The actual declaration of PI
as a variable happens on the fourth line of this
README. The root describe treats any code blocks after it as global setup.
FAQs
Write jasmine tests in markdown as documentation
We found that literate-jasmine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.