corde
corde copied to clipboard
Corde 5.0.0
The following list contains all enhancements and changes in corde v5:
💣 Breaking changes
The following content represents all changes that will make your application break after migrating to v5:
Expect function rework
"Rename" expect
function to command
Actually, the expect
function will still exist, but with a different purpose. What the previous expect
did, now is made by the command
function.
So, if the goal is to test bots, use the command
function.
command
now returns a helper function instead of directly returning the testing methods.
The old command
function was like this:
expect("ping").toReturn("");
- It was called
expect
. - Was sync.
- Testing methods had the
to
prefix.
Now it looks like this:
await command("ping").should.return("pong");
With the assertion library enhancement, use expect to test bots AND to provide
🚀 Features
Add assertion testing
Corde now supports assertion testing using a jest like sintax:
it("it's a test!", () => {
expect(1).toEqual(1);
});
As you can see, expect
is also the same name for bot testing function in preview versions of corde, but now, to test bots, the function calls command
[There will be a link for all assertion tests]
Codecov Report
Merging #1024 (0eeda21) into master (f90c579) will decrease coverage by
16.23%
. The diff coverage is68.58%
.
:exclamation: Current head 0eeda21 differs from pull request most recent head 6d29cd6. Consider uploading reports for the commit 6d29cd6 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## master #1024 +/- ##
===========================================
- Coverage 90.55% 74.32% -16.24%
===========================================
Files 95 198 +103
Lines 2743 4744 +2001
Branches 594 1067 +473
===========================================
+ Hits 2484 3526 +1042
- Misses 259 1218 +959
Impacted Files | Coverage Δ | |
---|---|---|
src/command/matches/shouldHaveResult.ts | 0.00% <0.00%> (ø) |
|
src/core/debug.ts | 62.50% <ø> (ø) |
|
src/core/injectGlobals.ts | 0.00% <0.00%> (ø) |
|
src/core/intentHelper.ts | 0.00% <0.00%> (ø) |
|
src/core/printHookError.ts | 0.00% <0.00%> (ø) |
|
src/errors/assertionError.ts | 0.00% <0.00%> (ø) |
|
src/errors/commandTestError.ts | 0.00% <0.00%> (ø) |
|
src/errors/configError.ts | 100.00% <ø> (ø) |
|
src/errors/cordeClientError.ts | 100.00% <ø> (ø) |
|
src/errors/discordJSError.ts | 0.00% <ø> (ø) |
|
... and 200 more |
SonarCloud Quality Gate failed. Â
9 Bugs
0 Vulnerabilities
3 Security Hotspots
225 Code Smells
No Coverage information
8.8% Duplication
SonarCloud Quality Gate failed. Â
9 Bugs
0 Vulnerabilities
0 Security Hotspots
99 Code Smells
No Coverage information
8.8% Duplication