0.0.10 • Published 3 years ago

test-with-data-folder v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

test-with-data-folder

Take a test data folder and automatically copy, modify, compare against expected data, and remove.

Example

const testWithDataFolder = require("test-with-data-folder");
const { testCase1Func } = require("./test-case-1/testCase1Func"); // Function under test

test('test case 1', () => {
  // Define paths
  const inputFolder = "./tests/test-case-1/input";
  const expectedFolder = "./tests/test-case-1/expected";
  const temporaryFolder = "./tests/test-case-1/temp";

  // Define the function under test
  const testFunction = () => { testCase1Func(temporaryFolder); };

  // Run the test
  testWithDataFolder(testFunction, inputFolder, expectedFolder, temporaryFolder);
});

The testWithDataFolder method will:

  1. Delete temporaryFolder
  2. Copy inputFolder to temporaryFolder
  3. Run testFunction()
  4. Compare temporaryFolder against expectedFolder
  5. Delete temporaryFolder
0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.5

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago