testHelpers

Source: testHelpers.mjs:10

Export the setUp helper.


Static Fields

createTempDir

Ensure that the del has completed, recursively attempt to delete and recreate

Parameters

  • exists (boolean, optional, default: true)

Returns

  • Promise.<(*|void)>

beforeEach

In the Jest.beforeEach function call this one to set up the temp directory.

Returns

  • Promise.<(*|void)>

afterEach

In the Jest.afterEach function call this one to clean up and remove the temp directory.

Returns

  • Promise.<*>

countMatches

Return number of occurrences of substring in another string.

Returns

  • int

fileExists

Returns true if the given file or directory exists, otherwise false.

Returns

  • boolean

logObject

Console log objects in a readable format, returns the given object.

Returns

  • *

removeDirectory

Delete a directory and subcontents.

Returns

  • Promise.<*>

Other

setDefaults

Update the gulp configurations with the test data. Set the test directory where temp files will be created for testing.

Parameters

  • testDir (string)