Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING(v2): remove test runner; introduce test doubles #132

Merged
merged 71 commits into from
Apr 16, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
2233216
BREAKING: Remove rhum runner
ebebbington Oct 25, 2021
38d2fd2
add back mock builder and types
ebebbington Jan 24, 2022
0c44ea7
Merge branch 'main' into breaking-remove-runner
ebebbington Jan 24, 2022
cc0cc1d
fmt
ebebbington Jan 24, 2022
83e7493
fix tests
ebebbington Jan 24, 2022
809b168
tpo
ebebbington Jan 24, 2022
2241851
Merge branch 'main' into breaking-remove-runner
ebebbington Apr 9, 2022
ee9f820
use mock and stub
ebebbington Apr 9, 2022
289c455
feat(mock): add mock.method(...).willReturn(...);
crookse Apr 10, 2022
caf0ea8
chore: cleaning up
crookse Apr 11, 2022
62fed94
feat: add mock.method(...).willThrow(...)
crookse Apr 11, 2022
fd258ac
test: mock.method().willThrow() and mock.method().willReturn()
crookse Apr 11, 2022
df28899
feat: add mixin for mock
crookse Apr 11, 2022
d5833f1
fix: issue with redefining getters and setters
crookse Apr 11, 2022
73996ee
test: testing current implementations thus far
crookse Apr 11, 2022
c2fa3de
Merge branch 'feat/mock-as-mixin' into feat/configurable-methods-spie…
crookse Apr 11, 2022
6a1e98b
Merge branch 'fix-getters' into feat/new-mock-methods
crookse Apr 11, 2022
6299ba2
feat: add dummy logic
crookse Apr 12, 2022
8f5f5d9
chore: clean up
crookse Apr 12, 2022
825748b
chore: move mock logic into mock folder
crookse Apr 12, 2022
0689930
feat: fakes
crookse Apr 12, 2022
dc303a5
Merge branch 'feat/dummies' into feat/new-mock-methods
crookse Apr 12, 2022
647bd2d
chore: deno fmt
crookse Apr 12, 2022
0cb4c75
chore: fix doc block
crookse Apr 12, 2022
937c23f
feat: add method expectation calls for mocks
crookse Apr 12, 2022
3d00a25
chore: fix param name
crookse Apr 12, 2022
b45e231
test: add test creating dummy without constructor args
crookse Apr 12, 2022
4d05200
chore: make setter adjacent to getter
crookse Apr 12, 2022
37cacc0
chore: make file marker comment bigger
crookse Apr 12, 2022
49e9fbe
refactor!: change stub to only stub data members
crookse Apr 12, 2022
5cfcaab
feat: new readme
crookse Apr 12, 2022
05c66d2
docs: update README to state Gerard Meszaros
crookse Apr 12, 2022
15dd9cd
chore: state Gerard Meszaros in doc blocks
crookse Apr 12, 2022
b1e4c77
fix: accidentally removed Constructor type import
crookse Apr 12, 2022
cf1297f
chore: deno fmt and clean up
crookse Apr 12, 2022
1e9d2c5
refactor!: shorten syntax to stub class properties and methods; make …
crookse Apr 12, 2022
50e9dc5
chore: cleaning up
crookse Apr 13, 2022
ca2b88e
chore: remove other mock test file
crookse Apr 13, 2022
cc0ebdf
fix: change README title to Rhum
crookse Apr 13, 2022
92bd978
chore: remove playground files
crookse Apr 13, 2022
08e47ef
chore: remove constructor comment; move init method down
crookse Apr 13, 2022
d3fbffe
Merge pull request #150 from drashland/feat/new-mock-methods
crookse Apr 14, 2022
4975eb1
ci(v2): fix workflow file to only run tests/unit folder
crookse Apr 14, 2022
6fb3802
chore: update gitignore
crookse Apr 15, 2022
15b2f38
feat: initial script to compile to cjs and esm
crookse Apr 15, 2022
630bfb8
feat: add package.json and tsconfig.json files
crookse Apr 15, 2022
4824acc
chore: yarn.lock
crookse Apr 15, 2022
75c112a
chore: move deno unit tests to tests/deno
crookse Apr 15, 2022
63057b5
fix: issue with compiling down
crookse Apr 15, 2022
1f9f95f
test: cjs tests
crookse Apr 15, 2022
6b0d6cc
fix: issue with erratic builds
crookse Apr 15, 2022
79c26a2
fix: issue with testing esm
crookse Apr 15, 2022
5f5458d
chore: remove test for protected methods (should not do this)
crookse Apr 15, 2022
b82f72c
test: esm tests
crookse Apr 15, 2022
1f11a36
chore: remove yarn.lock
crookse Apr 15, 2022
f41f68a
Merge pull request #157 from drashland/feat/rhum-v2-node-browser-support
crookse Apr 16, 2022
0af2223
Merge branch 'main' into breaking-remove-runner
crookse Apr 16, 2022
631c18a
ci: add node unit tests
crookse Apr 16, 2022
6b1006e
chore: deno fmt
crookse Apr 16, 2022
b6656b0
ci: fix unit test runs for deno
crookse Apr 16, 2022
580c2b0
fix: tsconfig to point to include conversion workspace dir
crookse Apr 16, 2022
e2b82d7
chore: deno fmt
crookse Apr 16, 2022
899c364
chore: alphabetize scripts; add script to check build
crookse Apr 16, 2022
8ee1878
chore: deno fmt node config files
crookse Apr 16, 2022
1254456
ci: install node.. duh
crookse Apr 16, 2022
f6db265
ci: remove node 10 and 12
crookse Apr 16, 2022
b677420
ci: add deno to tests_node (required for building cjs and esm)
crookse Apr 16, 2022
567de91
ci: fix scripts to work in powershell
crookse Apr 16, 2022
a9b4bbe
chore: fix ci to work with windows; remove console log statements
crookse Apr 16, 2022
b0c5c75
ci: add yarn publish
crookse Apr 16, 2022
0ce4ed3
Merge pull request #159 from drashland/ci/add-yarn-publish
crookse Apr 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2

- name: Install Deno
uses: denolib/setup-deno@master
uses: denoland/setup-deno@v1

- name: Unit
run: deno test --allow-env tests/unit
run: deno test tests/unit

- name: Integration
run: deno test --allow-run --allow-env tests/integration
run: deno test tests/integration

linter:
# Only one OS is required since fmt is cross platform
Expand All @@ -35,10 +35,10 @@ jobs:
- uses: actions/checkout@v2

- name: Install Deno
uses: denolib/setup-deno@master
uses: denoland/setup-deno@v1

# - name: Lint
# run: deno lint --unstable
- name: Lint
run: deno lint

- name: Formatter
run: deno fmt --check
Expand Down
36 changes: 6 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="./logo.svg" height="250" alt="Rhum - A lightweight testing framework for Deno.">
<h1 align="center">Rhum</h1>
</p>
<p align="center">A lightweight testing framework for Deno.</p>
<p align="center">A test double module to stub and mock your code</p>
<p align="center">
<a href="https://github.com/drashland/rhum/releases">
<img src="https://img.shields.io/github/release/drashland/rhum.svg?color=bright_green&label=latest">
Expand All @@ -25,13 +25,10 @@

### Features

- Descriptive naming for your tests
- Lightweight
- Zero 3rd party dependencies
- Simple and easy to use
- Asynchronous support
- Still uses `Deno.test` under the hood
- Skip functionality
- Mock requests
- Hooks

Expand All @@ -40,32 +37,11 @@
To add Rhum to your project, follow the quick start guide
[here](https://drash.land/rhum/#/#quickstart).

### Why Use Rhum?
## Contributing

Rhum allows you to write tests in a very descriptive way -- from a code
perspective or output perspective.

Rhum is designed to aid your testing efforts -- providing many utilities as
wrappers around Deno's existing `Deno.test`. Rhum is meant to improve the user
experience when it comes to writing tests, such as:

- Readability for test cases
- Features that aren't available in Deno yet (hooks)

Rhum takes concepts from the following:

- <a href="https://mochajs.org/" target="_BLANK">Mocha</a> &mdash; For how you
write tests in Rhum, and the use of
<a href="https://mochajs.org/#hooks" target="_BLANK">hooks</a>
- <a href="https://volument.com/baretest" target="_BLANK">Baretest</a> &mdash;
Being minimalistic

Rhum can be added directly into any project. All you need to do is import Rhum
and you are ready to start writing tests or bring your existing tests under
Rhum.
Want to contribute? Follow the Contributing Guidelines
[here](https://github.com/drashland/.github/blob/master/CONTRIBUTING.md).

---
## License

Want to contribute? Follow the Contributing Guidelines
[here](https://github.com/drashland/.github/blob/master/CONTRIBUTING.md). All
code is released under the [MIT License](./LICENSE).
All code is released under the [MIT License](./LICENSE).
5 changes: 0 additions & 5 deletions deps.ts

This file was deleted.

4 changes: 1 addition & 3 deletions egg.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "rhum",
"description": "A lightweight testing framework for Deno.",
"description": "A test double module to stub and mock your code.",
"version": "1.1.11",
"stable": true,
"repository": "https://github.com/drashland/rhum",
"files": [
"./mod.ts",
"./deps.ts",
"./src/**/*",
"./README.md",
"./logo.svg",
"LICENSE"
Expand Down
29 changes: 0 additions & 29 deletions example_tests/basic/1.ts

This file was deleted.

29 changes: 0 additions & 29 deletions example_tests/basic/1_fail.ts

This file was deleted.

47 changes: 0 additions & 47 deletions example_tests/basic/2.ts

This file was deleted.

32 changes: 0 additions & 32 deletions example_tests/basic/3.ts

This file was deleted.

3 changes: 0 additions & 3 deletions example_tests/basic/tests_fail.ts

This file was deleted.

3 changes: 0 additions & 3 deletions example_tests/basic/tests_pass.ts

This file was deleted.

Loading