Skip to content

Commit

Permalink
Merge branch 'main' into add-badges-to-readme-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ShellyDCMS authored Jul 9, 2024
2 parents 47edcfd + 7dc4f9e commit 35c7add
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/npm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.18.2
registry-url: https://registry.npmjs.org/
Expand All @@ -28,14 +33,14 @@ jobs:
- name: ✔️ Cypress Tests Report
uses: phoenix-actions/test-reporting@v8
id: test-report
if: always()
if: github.repository == 'ShellyDCMS/ts-stubber'
with:
name: Cypress Tests
path: ${{ github.workspace }}/cypress/results/json/mochawesome.json
reporter: mochawesome-json
- name: ✅ Jest Test Results
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
if: github.repository == 'ShellyDCMS/ts-stubber'
with:
name: JEST Tests # Name of the check run which will be created
path: test-report.xml # Path to test results
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ class MyClass {
throw new Error("Should not be called");
}
}

// creating a stubbed instance using the native node:test module
const const nodeStubbedInstanceCreator = StubbedInstanceCreator<MyClass, Mock<Function>>(
() => mock.fn()
);

const nodeMockMyClass = nodeStubbedInstanceCreator.createStubbedInstance();

// creating a stubbed instance using sinon
const sinonStubbedInstanceCreator = StubbedInstanceCreator<MyClass, SinonStub>(
() => sinon.stub()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ts-stubber",
"description": "Lazy Stubbing a TypeScript Class or Interface with any Mocking Framework for testing in Isolation",
"version": "1.0.9",
"version": "1.0.12",
"author": "Shelly Goldblit",
"private": false,
"license": "MIT",
Expand Down

0 comments on commit 35c7add

Please sign in to comment.