Skip to content

Commit

Permalink
Merge branch 'master' into issue-#3-hooks-tests-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Bebbington committed Jun 22, 2020
2 parents c11a979 + e0001ca commit 0a3d5da
Show file tree
Hide file tree
Showing 8 changed files with 306 additions and 21 deletions.
49 changes: 49 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contributing to Rhum

## Bug Reports

A bug is a *demonstrable problem* that is caused by the code in the repository. Good bug reports are extremely helpful, so thanks!
If you want to report a bug, click [here](https://github.com/drashland/rhum/issues/new?assignees=&labels=bug&template=bug_report.md&title=).

## Feature Requests
Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project developer of the merits of this feature. Please provide as much detail and context as possible. If you want to request a feature, click [here](https://github.com/drashland/rhum/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=).

## Pull Requests

Please **ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.

1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, and configure the remotes:
```bash
# Clone your fork of the repo into the current directory
git clone https://github.com/<your-username>/rhum.git
# Navigate to the newly cloned directory
cd rhum
# Assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/drashland/rhum.git
```
2. If you cloned a while ago, get the latest changes from upstream:
```bash
git checkout master
git pull upstream master
```
3. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix:
```bash
git checkout -b <topic-branch-name>
```
4. Push your topic branch up to your fork:
```bash
git push origin <topic-branch-name>
```
5. [Open a Pull Request](https://help.github.com/articles/about-pull-requests/) with a clear title and description against the `master` branch.

***Note:*** It is recommended that you *"clean up"* your commits before opening a pull request. Maybe take a look at `git rebase --interactive` to do this.

## Code Guidelines
- Code should follow [Deno Style Guide](https://deno.land/manual/contributing/style_guide).

- As a rule of thumb, always format your code using `deno fmt` before opening your pull request. Run this as your last single commit. If you forgot to correctly format it, just add a commit with the message *deno fmt* (`git commit -m "deno fmt"`).

## License
By submitting a patch, you agree to allow the project owners to license your work under the terms of the [MIT License](../LICENSE).


30 changes: 30 additions & 0 deletions .github/workflows/bumper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: bumper
on:
schedule:
- cron: '0 0 * * *'

jobs:
update-dep:
strategy:
matrix:
deno: ["1.1.1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install Deno
uses: denolib/setup-deno@master
with:
deno-version: ${{ matrix.deno }}

- name: Update Dependencies
run: deno run --allow-net --allow-read --allow-write https://deno.land/x/dmm/mod.ts update

- name: Create Pull Request
uses: peter-evans/create-pull-request@v2
with:
token: ${{ secrets.CI_USER_PAT }}
commit-message: Update dependencies
title: Update dependencies
body: This was auto-generated by GitHub Actions.
branch: update-dependencies
5 changes: 4 additions & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
deno: ["1.1.0"]
deno: ["1.1.1"]
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -27,6 +27,9 @@ jobs:
- name: Unit
run: deno test tests/unit

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

linter:
strategy:
matrix:
Expand Down
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2020 the Rhum authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Allows a test plan, suite, or case to be skipped when the tests run.

```typescript
Rhum.testPlan("app_test.ts", () => {
Rhum.skip("run()", () => { // Will not run this block
Rhum.skip("run()", () => { // will not run this block
Rhum.testCase("Returns true", () => {
...
});
Expand All @@ -186,6 +186,9 @@ Rhum.testPlan("app_test.ts", () => {
Rhum.testCase("Returns true", () => {
...
});
Rhum.skip("Returns true", () => { // will not run this block
...
});
});
});
```
Expand Down Expand Up @@ -312,9 +315,9 @@ A variety of hooks that can be run before or after test suites and cases.

## Why Use Rhum?

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

Rhum is designed to aid in testing your projects, 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:
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)
Expand All @@ -324,7 +327,7 @@ 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 either start writing tests, and bring your existing tests under Rhum.
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.

## Contributing

Expand Down
8 changes: 5 additions & 3 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export { ServerRequest } from "https://deno.land/std@v0.57.0/http/server.ts";
export { ServerRequest } from "https://deno.land/std@v0.58.0/http/server.ts";

export { BufReader } from "https://deno.land/std@v0.57.0/io/bufio.ts";
export { BufReader } from "https://deno.land/std@v0.58.0/io/bufio.ts";

export * as asserts from "https://deno.land/[email protected]/testing/asserts.ts";
export * as asserts from "https://deno.land/[email protected]/testing/asserts.ts";

export * as colors from "https://deno.land/[email protected]/fmt/colors.ts";
2 changes: 1 addition & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export class RhumRunner {
if (this.test_plan_in_progress != this.passed_in_test_plan) {
this.test_plan_in_progress = this.passed_in_test_plan;
this.test_suite_in_progress = this.passed_in_test_suite;
newName = `${"\u0008".repeat(name.length + extraChars)}` +
newName = `${"\u0008".repeat(name.length + extraChars)}` + // strip "test "
`${" ".repeat(name.length + extraChars)}` +
`\n${this.passed_in_test_plan}` +
`\n ${this.passed_in_test_suite}` +
Expand Down
Loading

0 comments on commit 0a3d5da

Please sign in to comment.