drashland / rhum

A test double library
https://drash.land/rhum
MIT License
92 stars 6 forks source link

Issue #16 skipped functionality #76

Closed crookse closed 4 years ago

crookse commented 4 years ago

Fixes #16

Description

.testSuite() and .testCase() calls can be replaced with .skip().

You can now do the following:

Rhum.testPlan(() => {
  Rhum.skip("testSuite skipped 1", () => {
    Rhum.testCase("skipped", () => {
      Rhum.asserts.assertEquals(true, true);
    });
    Rhum.testCase("skipped", () => {
      Rhum.asserts.assertEquals(true, true);
    });
  });

  Rhum.skip("testSuite skipped 2", () => {
    Rhum.testCase("skipped", () => {
      Rhum.asserts.assertEquals(true, true);
    });
  });

  Rhum.testSuite("testSuite not skipped 3", () => {
    Rhum.testCase("testCase", () => {
      Rhum.asserts.assertEquals(true, true);
    });
    Rhum.skip("skipped", () => {
      Rhum.asserts.assertEquals(true, true);
    });
    Rhum.skip("skipped", () => {
      Rhum.asserts.assertEquals(true, true);
    });
  });

  Rhum.testSuite("testSuite not skipped 4", () => {
    Rhum.skip("skipped", () => {
      Rhum.asserts.assertEquals(true, true);
    });
    Rhum.testCase("testCase", () => {
      Rhum.asserts.assertEquals(true, true);
    });
  });

  Rhum.testSuite("testSuite not skipped 5", () => {
    Rhum.skip("skipped", () => {
      Rhum.asserts.assertEquals(true, true);
    });
    Rhum.skip("skipped", () => {
      Rhum.asserts.assertEquals(true, true);
    });
    Rhum.testCase("testCase", () => {
      Rhum.asserts.assertEquals(true, true);
    });
  });

  Rhum.skip("testSuite skipped 6", () => {
    Rhum.testCase("skipped", () => {
      Rhum.asserts.assertEquals(true, true);
    });
  });

  Rhum.testSuite("testSuite not skipped 7", () => {
    Rhum.testCase("testCase", () => {
      Rhum.asserts.assertEquals(true, true);
    });
    Rhum.skip("skipped", () => {
      Rhum.asserts.assertEquals(true, true);
    });
    Rhum.testCase("testCase", () => {
      Rhum.asserts.assertEquals(true, true);
    });
  });
});
crookse commented 4 years ago

I think maybe some more tests could be added, mainly integration ones that assert the output is correct with the new format

agreed. as i'm testing the rhumrunner, i'm finding that some of my code isn't testable. so i'm also reworking some of the stuff i did to make the rhumrunner testable as fuhhhh

crookse commented 4 years ago

@ebebbington, i added out output_test.ts. i also tested mod.ts.

https://github.com/drashland/rhum/blob/issue-%2316-skipped-functionality/tests/integration/output_test.ts

https://github.com/drashland/rhum/blob/issue-%2316-skipped-functionality/tests/unit/mod_test.ts