I would suggest setting up a Docker image for Javascript environment consisting of key tools such as grunt, jscs, jshint, typescript, browserify, nodejs etc. Check my page on How to setup Javascript Dev Environment using Dockers.
Set the Jasmine config property (environment variable) pointing to folder where jasmine.json file can be found. As I am executing jasmine from topmost folder (/home/ashukla/js) under which jasmine.json is found, I set the path by executing “export JASMINE_CONFIG_PATH=/home/ashukla/js/jasmine.json”.
Make a directory under with following subfolders and a configuration file will be placed:
{
"spec_dir": "spec",
"spec_files": [
"**/*[sS]pec.js"
],
"helpers": [
"helpers/**/*.js"
],
"stopSpecOnExpectationFailure": false,
"random": false
}
function Person(){
this.age = 0;
this.isAdult = false;
};
Person.prototype.setAge = function(age) {
this.age = age;
if(this.age > 17) {
this.isAdult = true;
} else {
this.isAdult = false;
}
};
module.exports = Person;
describe("Person", function() {
var Person = require('../lib/Person');
var person;
beforeEach(function() {
person = new Person();
});
it("is not an adult", function() {
expect(person.isAdult).toBe(false);
person.setAge(16);
expect(person.isAdult).toBe(false);
});
it("is an adult", function() {
person.setAge(18);
expect(person.isAdult).toBe(true);
});
});
Large language models (LLMs) have fundamentally transformed our digital landscape, powering everything from chatbots and…
As Large Language Models (LLMs) evolve into autonomous agents, understanding agentic workflow design patterns has…
In today's data-driven business landscape, organizations are constantly seeking ways to harness the power of…
In this blog, you would get to know the essential mathematical topics you need to…
This blog represents a list of questions you can ask when thinking like a product…
AI agents are autonomous systems combining three core components: a reasoning engine (powered by LLM),…