JavaScript Testing: Jasmine Spies
Spies, the Jasmine implementation for mocks
featuring spyOn
& spyOnProperty
as well as jasmine.createSpy(Obj)
and how to inspect calls made.
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},
};
sheet.Cells["A1"].LoadFromCollection(data);
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
:
In case your users want to continue working with the Excels after generation.
Not a problem for EPPlus. Instead of calculating values and writing them to an excel, leverage the power of Excel formulas.
Version 4.5.3.3 is the last version of EPPlus you can use without a license for commercial use.
See some alternatives if that is a dealbreaker for you!
Last update on Mar 28, 2023
jasmine-ts is deprecated. Updated to Jasmine 4.3.0.
Last update on Mar 28, 2023
Added double keypress hotkey example
Last update on Mar 10, 2023
EPPlus is no longer free for commercial use!
Last update on Mar 8, 2023
Added Distinct, flatMap
Last update on Mar 8, 2023
Added notice about MomentJS being in maintenance mode
Last update on Jan 16, 2020
Published to the PowerShell Gallery