Skip to content

Commit

Permalink
Merge pull request #187 from ngarbezza/develop
Browse files Browse the repository at this point in the history
Release v5.1.0 to main branch
  • Loading branch information
ngarbezza authored Jan 14, 2021
2 parents d250ed2 + b8ed563 commit 8846f66
Show file tree
Hide file tree
Showing 53 changed files with 1,942 additions and 1,290 deletions.
39 changes: 39 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,45 @@
"avatar_url": "https://avatars0.githubusercontent.com/u/5412270?v=4",
"profile": "http://adico.tech",
"contributions": [
"code",
"test"
]
},
{
"login": "ask-imran",
"name": "Askar Imran",
"avatar_url": "https://avatars0.githubusercontent.com/u/20487103?v=4",
"profile": "https://github.com/ask-imran",
"contributions": [
"code",
"test"
]
},
{
"login": "niyonx",
"name": "Nigel Yong",
"avatar_url": "https://avatars2.githubusercontent.com/u/23243585?v=4",
"profile": "http://www.nigelyong.com/",
"contributions": [
"code"
]
},
{
"login": "chelsieng",
"name": "Chelsie Ng",
"avatar_url": "https://avatars1.githubusercontent.com/u/60008262?v=4",
"profile": "https://github.com/chelsieng",
"contributions": [
"code"
]
},
{
"login": "trochepablo",
"name": "Pablo T",
"avatar_url": "https://avatars2.githubusercontent.com/u/18213369?v=4",
"profile": "https://github.com/trochepablo",
"contributions": [
"test",
"code"
]
}
Expand Down
34 changes: 29 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,47 @@
},
"extends": "eslint:recommended",
"env": {
"es6": true,
"browser": false,
"es6": true,
"node": true
},
"rules": {
"semi": 2,
"arrow-spacing": "warn",
"block-spacing": "warn",
"block-scoped-var": "error",
"brace-style": "warn",
"camelcase": "warn",
"comma-dangle": ["warn", "always-multiline"],
"comma-spacing": "warn",
"comma-style": "warn",
"constructor-super": "error",
"curly": "error",
"dot-notation": "error",
"dot-location": ["error", "property"],
"eqeqeq": "error",
"eol-last": "error",
"func-call-spacing": "error",
"id-length": "error",
"indent": ["error", 2],
"keyword-spacing": "error",
"new-cap": "error",
"new-parens": "error",
"no-cond-assign": "error",
"no-eval": "error",
"no-ex-assign": "error",
"no-extend-native": "error",
"no-multi-spaces": "error",
"no-multiple-empty-lines": "error",
"no-param-reassign": "error",
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"no-var": "error",
"object-curly-spacing": ["warn", "always"],
"prefer-const": "error",
"arrow-spacing": "warn",
"dot-location": ["error", "property"],
"prefer-template": "warn"
"prefer-template": "warn",
"quotes": [2, "single", "avoid-escape"],
"semi": 2,
"space-before-function-paren": ["error", "never"],
"space-infix-ops": "error",
"space-in-parens": "warn"
}
}
2 changes: 0 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [8.x, 10.x, 12.x, 14.x]

steps:
- name: Checkout repo
uses: actions/checkout@v1
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
.idea/
coverage/
coverage/
.nyc_output/
37 changes: 36 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Everything is released. Yay! :tada:

## [5.1.0] - 2021-01-13

This release includes a lot of contributions (4 new contributors!), and several refactorings to continue improving the quality of the tool.

### Added

* [[feature] added after() hook to run code after each test](https://github.com/ngarbezza/testy/issues/135), thank you @adico1!
* [[feature] isIncludedIn() and isNotIncludedIn() assertions](https://github.com/ngarbezza/testy/issues/75), thank you @ask-imran for your first contribution!
* [[feature] warning message when no tests found](https://github.com/ngarbezza/testy/issues/157), thank you @niyonx for your first contribution!
* [[feature] show error when a requested file does not exist](https://github.com/ngarbezza/testy/issues/158), thank you @chelsieng for your first contribution!
* [[feature] global error handler](https://github.com/ngarbezza/testy/issues/177)

### Fixed

* [[bug] suite and test names cannot be empty](https://github.com/ngarbezza/testy/issues/136), thank you @ask-imran!
* [[bug] includes() and doesNotInclude() matchers only work on Arrays](https://github.com/ngarbezza/testy/issues/130), thank you @trochepablo for your first contribution!
* [[bug] color for pending summary was not painted](https://github.com/ngarbezza/testy/issues/173)
* [[bug] it was possible to mark tests as pending without specifying reason](https://github.com/ngarbezza/testy/issues/172)

### Refactored

* [rename "master" branch to "main"](https://github.com/ngarbezza/testy/issues/133); also, an ADR was added to track the decision that we want a better vocabulary
* [parametrizable i18n messages](https://github.com/ngarbezza/testy/issues/71)
* [write more tests for the i18n module](https://github.com/ngarbezza/testy/issues/179)
* [throw error objects instead of strings](https://github.com/ngarbezza/testy/issues/176)
* [speed up tests by not creating error messages on successful assertions](https://github.com/ngarbezza/testy/commit/531d1d6360c93a3aae2f11bd0c957c45e93cd35c)
* [added some npm scripts for test coverage and dependencies graph](https://github.com/ngarbezza/testy/commit/d4ca1fa7804b2353458eb214d1f302fefc9fed9d)
* [changes in modularization: extract assertion and test result reporter](https://github.com/ngarbezza/testy/commit/4913b5a187bc0700b3de4b5b1a9adc0e2a8dc57e)
* add more tests and increased the current coverage ([example 1](https://github.com/ngarbezza/testy/commit/be41db9872ea4490b5dae238d6c553b214667326), [example 2](https://github.com/ngarbezza/testy/commit/28b2ee51078300382c7398cb40203d6e40ca26d1))
* formatter object decoupled from console ui (ADR 0004 added [here](https://github.com/ngarbezza/testy/commit/9ab5c55fd4738054effef1e1aab15824a62c6750))
* avoid test doubles at all (ADR 0005 added [here](https://github.com/ngarbezza/testy/commit/5a65fbc6e6e58b1f03f996c381240d4a1b8c3875)), removed test runner double

... and more minor cleanups.

## [5.0.2] - 2020-10-13

A hacktoberfest release! 5 bugs fixed and two new contributors! :muscle:
Expand Down Expand Up @@ -205,7 +239,8 @@ readable and extensible. It also includes a huge internal refactor to make the t
### Changed
- Fix passed count at test runner level (no reported issue)

[Unreleased]: https://github.com/ngarbezza/testy/compare/v5.0.2...HEAD
[Unreleased]: https://github.com/ngarbezza/testy/compare/v5.1.0...HEAD
[5.1.0]: https://github.com/ngarbezza/testy/compare/v5.0.2...v5.1.0
[5.0.2]: https://github.com/ngarbezza/testy/compare/v5.0.1...v5.0.2
[5.0.1]: https://github.com/ngarbezza/testy/compare/v5.0.0...v5.0.1
[5.0.0]: https://github.com/ngarbezza/testy/compare/v4.4.0...v5.0.0
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Nahuel Garbezza
Copyright (c) (2018-2021) Nahuel Garbezza

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
![dependencies](https://img.shields.io/david/ngarbezza/testy.svg?logo=dependabot)
\
![package-size](https://img.shields.io/bundlephobia/min/@pmoo/testy.svg?logo=npm)
![activity](https://img.shields.io/github/commit-activity/w/ngarbezza/testy.svg?logo=npm)
![activity](https://img.shields.io/github/commit-activity/m/ngarbezza/testy?logo=npm)
![release-date](https://img.shields.io/github/release-date/ngarbezza/testy.svg?logo=npm)
\
[![all-contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?logo=open-source-initiative)](#contributors)
[![all-contributors](https://img.shields.io/github/all-contributors/ngarbezza/testy?logo=open-source-initiative)](#Contributors)

A very simple JS testing framework, for educational purposes. Live at npm at [@pmoo/testy](https://www.npmjs.com/package/@pmoo/testy).

:arrow_right: [v4 (legacy version) documentation here](README_v4.md) \
:arrow_right: [Documentación en español aquí](README_es.md)

## Getting started
Expand Down Expand Up @@ -164,6 +163,23 @@ If you don't have a NPM project you can install testy globally using `npm instal
});
});
```
* **Running code after every test**: just like many testing frameworks have, there is a way to execute some code after (cleanp) every test in a suite using the `after()` function. Example:

```javascript
const { suite, test, before, after, assert } = require('@pmoo/testy');

suite('using the after() helper', () => {
let answer;

before(() => {
answer = 42;
});

after(() => {
answer = undefined;
});
});
```
* **Support for pending tests**: if a test has no body, it will be reported as `[WIP]` and it won't be considered a failure.
* **Fail-Fast mode**: if enabled, it stops execution in the first test that fails (or has an error). Remaining tests will be marked as skipped.
* **Run tests and suites in random order**: a good test suite does not depend on a particular order. Enabling this setting is a good way to ensure that.
Expand Down Expand Up @@ -216,7 +232,13 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/JavierGelatti"><img src="https://avatars2.githubusercontent.com/u/993337?v=4" width="100px;" alt=""/><br /><sub><b>Facundo Javier Gelatti</b></sub></a><br /><a href="https://github.com/ngarbezza/testy/commits?author=JavierGelatti" title="Tests">⚠️</a> <a href="https://github.com/ngarbezza/testy/commits?author=JavierGelatti" title="Code">💻</a></td>
<td align="center"><a href="https://codepen.io/TomerBenRachel/"><img src="https://avatars2.githubusercontent.com/u/23402988?v=4" width="100px;" alt=""/><br /><sub><b>Tomer Ben-Rachel</b></sub></a><br /><a href="https://github.com/ngarbezza/testy/commits?author=TomerPacific" title="Tests">⚠️</a> <a href="https://github.com/ngarbezza/testy/commits?author=TomerPacific" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/abraaoduarte"><img src="https://avatars2.githubusercontent.com/u/6676804?v=4" width="100px;" alt=""/><br /><sub><b>Abraão Duarte</b></sub></a><br /><a href="https://github.com/ngarbezza/testy/commits?author=abraaoduarte" title="Code">💻</a></td>
<td align="center"><a href="http://adico.tech"><img src="https://avatars0.githubusercontent.com/u/5412270?v=4" width="100px;" alt=""/><br /><sub><b>adico</b></sub></a><br /><a href="https://github.com/ngarbezza/testy/commits?author=adico1" title="Code">💻</a></td>
<td align="center"><a href="http://adico.tech"><img src="https://avatars0.githubusercontent.com/u/5412270?v=4" width="100px;" alt=""/><br /><sub><b>adico</b></sub></a><br /><a href="https://github.com/ngarbezza/testy/commits?author=adico1" title="Code">💻</a> <a href="https://github.com/ngarbezza/testy/commits?author=adico1" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/ask-imran"><img src="https://avatars0.githubusercontent.com/u/20487103?v=4" width="100px;" alt=""/><br /><sub><b>Askar Imran</b></sub></a><br /><a href="https://github.com/ngarbezza/testy/commits?author=ask-imran" title="Code">💻</a> <a href="https://github.com/ngarbezza/testy/commits?author=ask-imran" title="Tests">⚠️</a></td>
<td align="center"><a href="http://www.nigelyong.com/"><img src="https://avatars2.githubusercontent.com/u/23243585?v=4" width="100px;" alt=""/><br /><sub><b>Nigel Yong</b></sub></a><br /><a href="https://github.com/ngarbezza/testy/commits?author=niyonx" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/chelsieng"><img src="https://avatars1.githubusercontent.com/u/60008262?v=4" width="100px;" alt=""/><br /><sub><b>Chelsie Ng</b></sub></a><br /><a href="https://github.com/ngarbezza/testy/commits?author=chelsieng" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/trochepablo"><img src="https://avatars2.githubusercontent.com/u/18213369?v=4" width="100px;" alt=""/><br /><sub><b>Pablo T</b></sub></a><br /><a href="https://github.com/ngarbezza/testy/commits?author=trochepablo" title="Tests">⚠️</a> <a href="https://github.com/ngarbezza/testy/commits?author=trochepablo" title="Code">💻</a></td>
</tr>
</table>
Expand Down
5 changes: 2 additions & 3 deletions README_es.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
![dependencies](https://img.shields.io/david/ngarbezza/testy.svg?logo=dependabot)
\
![package-size](https://img.shields.io/bundlephobia/min/@pmoo/testy.svg?logo=npm)
![activity](https://img.shields.io/github/commit-activity/w/ngarbezza/testy.svg?logo=npm)
![activity](https://img.shields.io/github/commit-activity/m/ngarbezza/testy?logo=npm)
![release-date](https://img.shields.io/github/release-date/ngarbezza/testy.svg?logo=npm)
\
[![all-contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?logo=open-source-initiative)](#Contribuyentes)
[![all-contributors](https://img.shields.io/github/all-contributors/ngarbezza/testy?logo=open-source-initiative)](#Contribuyentes)

Una simple herramienta de testeo en Javascript, para propósitos educativos. Disponible en npm: [@pmoo/testy](https://www.npmjs.com/package/@pmoo/testy).

:arrow_right: [Documentación de v4 (versión anterior) aquí](README_v4_es.md) \
:arrow_right: [English version here](README.md)

## Para comenzar
Expand Down
Loading

0 comments on commit 8846f66

Please sign in to comment.