ospec('my function', function() { var add = function(num1, num2) { return num1 + num2; }; it('adds two numbers together', function() { expect(add(2, 3)).toBe(5); }); });
ospec('my function', function() { var isEven = function(num) { return num % 2 === 0; }; describe('isEven', function() { it('returns true if the number is even', function() { expect(isEven(2)).toBe(true); }); it('returns false if the number is odd', function() { expect(isEven(3)).toBe(false); }); }); });From these examples, it is clear that ospec.js is a package library for JavaScript that is used for writing test cases in a simple and easy-to-read format.