JavaScript Testing: Jasmine plugins
What would we be without some extra plugins. There are over 1000 Jasmine npm packages and we’ll cover them all here.
What would we be without some extra plugins. There are over 1000 Jasmine npm packages and we’ll cover them all here.
Make your Jasmine experience even more luscious with custom
matchers and global convenience methods.
Mock global variables in your modules with jasmine.getGlobal().pi = 3.14
.
Need to test async code? No problem for Jasmine.
There is done()
to inform Jasmine a test has finished running.
With jasmine.clock()
, the value of new Date()
can be manipulated.
Spies, the Jasmine implementation for mocks
featuring spyOn
& spyOnProperty
as well as jasmine.createSpy(Obj)
and how to inspect calls made.
The basic example contains the general test suite structure and the
two most used matchers toBe()
(===) and toEqual()
(deep compare),
followed by all the other matchers that come out of the box.
To finish some helpers for your workflow: how to only have certain tests run and how to exclude tests.
Probably the most widely used JavaScript testing framework.
This tutorial covers installation, configuration and execution only. For the Jasmine syntax, see parts 2 to 4!
EPPlus can do a whole lot more for you. This post covers some interesting stuff that didn’t really fit anywhere else.
Exporting data to an Excel doesn’t get easier than this
using (var package = new ExcelPackage())
{
var sheet = package.Workbook.Worksheets.Add("IEnumerable");
var data = new[]
{
new {Name = "A", Value = 1},
new {Name = "B", Value = 2},
new {Name = "C", Value = 3},
};
bool generateHeaders = true;
sheet.Cells["A1"].LoadFromCollection(data, generateHeaders);
// Overwrite headers with something fancier
sheet.Cells["A1"].SetHeaders("Name", "Value");
package.SaveAs(new FileInfo(@""));
}
Last update on Sep 14, 2024
Added mongo-secure
Last update on Jul 8, 2024
Added Show-Colors function
Last update on Jun 5, 2024
git filter-repo and Create-PullRequest for Github
Last update on Jun 1, 2024
Update to Angular v18: locale configuration, i18n pipes, updated official doc links etc
Last update on Jun 1, 2024
Added Object.groupBy
Last update on Mar 17, 2024
Fix for Google layout. Updated to manifest.json v3.