Comments (7)
Please share the code you have a written and there is no version 4.0 for @japa/runner.
from core.
test.group('computeMovementSummary()', async () => {
const counterparties = await Promise.all([
'input',
'pool',
'output',
].map((type: CounterpartyType) => CounterpartiesFactory.merge({ type }).create()))
const [input$$, pool$$, output$$] = counterparties;
const movements: { origin: string; destination: string; amount: number; }[] = [
{ origin: pool$$.id, destination: output$$.id, amount: 1000 },
{ origin: input$$.id, destination: pool$$.id, amount: 1000 },
]
test.group('with only one movement', () => {
const summary = computeMovementSummary([movements[0]], counterparties)
test('it should return the destination as pivot', (assert) => {
assert.equal(summary.pivot.id, pool$$.id)
})
test('it should return the base amount', (assert) => {
assert.equal(summary.amount, movements[0].amount)
})
})
test.group('with multiple movements (case: a reimbursement)', () => {
const summary = computeMovementSummary(movements, counterparties)
test('it should return the first destination as pivot', (assert) => {
assert.equal(summary.pivot.id, pool$$.id)
})
test('it should return a nil amount', (assert) => {
assert.equal(summary.amount, 0)
})
})
})
This is the code "in natural implementation way", for the two examples, here's what I tried.
// Property 'with' does not exist on type 'RunnerTest'.ts(2339)
test('it should return the first destination as pivot', (assert, c) => {
assert.equal(summary.pivot.id, c[1].id)
}).with(async () => await Promise.all([
'input',
'pool',
'output',
].map((type: CounterpartyType) => CounterpartiesFactory.merge({ type }).create())))
// Expected 2 arguments, but got 1.ts(2554)
test('it should return the first destination as pivot')
.with(async () => await Promise.all([
'input',
'pool',
'output',
].map((type: CounterpartyType) => CounterpartiesFactory.merge({ type }).create())))
from core.
What version of @japa/runner
are you using?
from core.
I didn't have @japa/runner
installed (since it wasn't mentioned in adonis' testing recipe), but after installing it, it's using the latest, so @japa/[email protected]
from core.
Then please follow the upgrade docs first. https://japa.dev/releases/version-5
from core.
That... could be useful to mention it on Adonis, at least as a content warning for an obsolete guide...
from core.
Agree. The cookbooks needs an updated. I will look into it :). Closing this issue for now
from core.
Related Issues (20)
- Can group initialization be asynchronous? HOT 5
- Running multiple files does not work HOT 1
- Custom order for running tests HOT 6
- Add Suite layer to Refiner HOT 2
- Change Private methods and properties to Protected to use Japa classes as Base classes HOT 2
- Broken documentation link HOT 1
- Cannot Access Assert from JapaFile.ts HOT 1
- Skip test by default when calling ".skip()" without parameter HOT 2
- Add the ability to use Dataset property in the title HOT 2
- Can't start adonis server when migrated to @japa/runner HOT 1
- Can't start tests on windows HOT 1
- OpenAPI HTTP Testing in Adonis with Japa HOT 1
- Match all tags in filter HOT 10
- Where to post some questions ? HOT 2
- Error in group functions is swallowed and not shown HOT 4
- Filter by group title also executes "root" tests HOT 5
- How get dynamic title for each test with array strings in dataset? HOT 1
- "Packages installation failed" Error on Windows Server 2019 and Windows 11 HOT 3
- [Feature suggestions] Mock Functions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.