unional / assertron Goto Github PK
View Code? Open in Web Editor NEWA supplementary assertion library
License: MIT License
A supplementary assertion library
License: MIT License
With 3.0, the internal state is pulled out into its own class StateMachine
.
It should be possible to implement ExpectOrder
with expect(...)
syntax.
AssertError is not precise and I'm moving away from using xxxError
to designate classes as Error.
Will see how far this will go.
btw this would be a patch increment as no one should use the assertion error types directly.
10.12.12
to 10.12.13
.This version is covered by your current version range and after updating it in your project the build failed.
@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
5.0.2
to 5.1.0
.This version is covered by your current version range and after updating it in your project the build failed.
satisfier is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 8 commits.
2b742bb
feat: add satisfies() function (#84)
892cb80
chore: update project
25b02f6
chore(package): update jest-junit to version 8.0.0 (#81)
c7e3053
Greenkeeper/tersify 3.0.6 (#82)
b995b76
chore(package): update jest-junit to version 7.0.0 (#79)
35859fe
chore(package): update tersify to version 3.0.4 (#78)
f3d4f94
Greenkeeper/tersify 3.0.3 (#76)
c4f1ba6
Greenkeeper/tersify 3.0.2 (#75)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
When reporting errors, the stack trace should not highlight the lines inside assertron
:
InvalidOrder: Expecting 'is(2)', 'once(2)', 'any([2])', but received 'any([3, 4])'
74 | const index = steps.indexOf(this.state.step)
75 | if (index === -1)
> 76 | throw new InvalidOrder(this.state.get(), 'any', steps)
77 | 78 | this.state.move()
79 | return steps[index]
at AssertOrder.Object.<anonymous>.AssertOrder.any (../assertron/src/AssertOrder.ts:76:13)
at src/function/function.spec.ts:79:15
at Object.on (src/specInternal.ts:172:9)
at Object.<anonymous> (src/function/function.spec.ts:78:13) at step (src/function/function.spec.ts:32:23)
at Object.next (src/function/function.spec.ts:13:51)
at fulfilled (src/function/function.spec.ts:4:56)
Using either async or promise (best), setTimeout.
Measurement code (startTick
) is a state.
It should be kept within the StateMachine
.
15.12.4
to 15.12.5
.This version is covered by your current version range and after updating it in your project the build failed.
semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
ci
option via API and config file (862ec4c)The new version differs by 8 commits.
649b530
docs: mention that debug
option is CLI only
862ec4c
fix: allow to set ci
option via API and config file
6b110b6
docs: switch to spectrum.chat
e4c6649
docs: syntax fixes in plugins list
6220641
docs: add @semantic-release/apm
to plugins list
a45273e
docs: add maven-semantic-release to list of community plugins
d109113
chore(package): update nyc and sinon
cd69583
test: delete unused test helper file
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Using either async or promise (best), setTimeout.
Error formatting is different responsibility from asserting execution order.
Currently, the error formatting code is embedded in the AsserOrder
class.
Let's extract the formatting code into its own file.
The formatting code should be tested separately.
master
branch failed. 🚨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project ✨
Your semantic-release bot 📦🚀
There are other assertions I would like to add, but creating other assertion library is not a good idea because users need to install multiple assertion libraries.
I think assertion library is a rare case that a mono library is better than nano-libraries.
With the advance of ESM, I believe nano-libraries will gradually combine to create cohesive micro-libraries.
4.14.118
to 4.14.119
.This version is covered by your current version range and after updating it in your project the build failed.
@types/lodash is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Currently, all tests are run against synchronous code.
While they should work with async code, we should write tests to show it.
Add tests to any()
, step()
, all()
, some()
, and once()
so that they run against code the executes asynchronously.
For example:
function foo() {
return new Promise(r => {
setTimeout(r, 1)
})
}
or function foo(cb) {
setTimeout(cb, 1)
}
For Promise
cases, it is better to use ES2017 async
/await
syntax: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
Using either async or promise (best), setTimeout.
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/codeql-analysis.yml
actions/checkout v3
github/codeql-action v3
github/codeql-action v3
github/codeql-action v3
.github/workflows/pull-request.yml
.github/workflows/release.yml
package.json
is-promise ^4.0.0
iso-error ^6.0.0
path-equal ^1.2.5
satisfier ^5.4.2
tersify ^3.11.1
type-plus ^7.6.0
@changesets/cli ^2.26.2
@commitlint/cli ^19.0.0
@commitlint/config-conventional ^19.0.0
@size-limit/preset-small-lib ^9.0.0
@types/jest ^29.0.0
@types/lodash ^4.14.182
@types/ncp ^2
@types/node ^18.0.0
@typescript-eslint/eslint-plugin ^7.0.0
depcheck ^1.4.3
eslint ^8.47.0
eslint-config-prettier ^9.0.0
eslint-plugin-harmony ^7.1.2
husky ^8.0.1
jest ^29.0.0
jest-validate ^29.0.0
jest-watch-suspend ^1.1.2
jest-watch-toggle-config ^3.0.0
jest-watch-typeahead ^2.0.0
lodash ^4.17.21
ncp ^2.0.0
npm-run-all2 ^6.0.0
pinst ^3.0.0
rimraf ^5.0.0
size-limit ^9.0.0
ts-jest ^29.0.0
tslib ^2.4.0
typescript ^5.0.0
node >= 10
pnpm 8.15.5
1.3.2
to 1.3.3
.This version is covered by your current version range and after updating it in your project the build failed.
@unional/devpkg-node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
https://nodejs.org/api/perf_hooks.html
Only from 8.5
☝️ Important announcement: Greenkeeper will be saying goodbye 👋 and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io
4.14.149
to 4.14.150
.This version is covered by your current version range and after updating it in your project the build failed.
@types/lodash is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Using either async
or promise
(best), setTimeout
.
4.14.142
to 4.14.143
.This version is covered by your current version range and after updating it in your project the build failed.
@types/lodash is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
once()
, step()
, any()
, some()
, all()
, multiple()
, next
are nice and short.
But may not be the best names for the API.
For example, originally I had:
const assert = new AssertOrder()
assert.step(1) // assert [we are executing] step 1
But later on alias step()
with once()
because step()
itself does not have clear distinction with some/all
etc.
Let's revise the API to see if there is a better scheme.
The purpose of each method are described in the JSDoc: https://github.com/unional/assert-order/blob/master/src/assertOrder.ts
Public method name should be short and concise. It normally should be verb or verb phrase, but in this case, it should be predicate or affirmation.
The invocation is weird. And the following does not work:
const o = AssertOrder(2)
const cb = (i) => {
o.any([1,2])
o.on(2, () => expect(i).toBe(2))
}
cb(1)
cb(2)
It got i = 1
.
The following works:
const o = AssertOrder(2)
const cb = (i) => {
o.on(2, () => expect(i).toBe(2))
o.any([1,2])
}
cb(1)
cb(2)
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.
Since we did not receive a CI status on the greenkeeper/initial
branch, we assume that you still need to configure it.
If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/
.
We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
4.14.122
to 4.14.123
.This version is covered by your current version range and after updating it in your project the build failed.
@types/lodash is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Using either async or promise (best), setTimeout.
interface Foo {
payload: any;
}
let action: Foo = {} as any
satisfy(action, { payload: 1 })
satisfy(action, { payload: true })
satisfy(action, { payload: 'a' })
satisfy(action, { payload: [1, 2, 3] })
satisfy(action, { payload: ['a', 'b', 'c'] })
satisfy(action, { payload: ['a', 1, true] })
satisfy(action, { payload: [null, 3, 4] }) // <-- error
Error is:
Argument of type '{ payload: (3 | 4 | null)[]; }' is not assignable
to parameter of type 'Expectation<Foo>'.
Type '{ payload: (3 | 4 | null)[]; }' is not assignable
to type 'Partial<ExpectationHash<Foo>>[]'.
Property 'length' is missing in type '{ payload: (3 | 4 | null)[]; }'
The cause is the ExpectationNode
in satisfier
is missing null
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (github>unional/renovate-preset)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.