JavaScript Testing: Jasmine customization
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
.
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(@""));
}
Comparing NSubstitute syntax with Moq, probably the most used mocking framework out there at the moment.
moq/moq4 :
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.