corde icon indicating copy to clipboard operation
corde copied to clipboard

Corde 5.0.0

Open lucasgmagalhaes opened this issue 3 years ago • 2 comments

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]

lucasgmagalhaes avatar Sep 21 '21 14:09 lucasgmagalhaes

Codecov Report

Merging #1024 (0eeda21) into master (f90c579) will decrease coverage by 16.23%. The diff coverage is 68.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

Impacted file tree graph

@@             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

codecov[bot] avatar Oct 07 '21 19:10 codecov[bot]

SonarCloud Quality Gate failed.    Quality Gate failed

Bug D 9 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 3 Security Hotspots
Code Smell A 225 Code Smells

No Coverage information No Coverage information
8.8% 8.8% Duplication

sonarqubecloud[bot] avatar Jun 20 '22 15:06 sonarqubecloud[bot]

SonarCloud Quality Gate failed.    Quality Gate failed

Bug D 9 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 99 Code Smells

No Coverage information No Coverage information
8.8% 8.8% Duplication

sonarqubecloud[bot] avatar Dec 26 '22 00:12 sonarqubecloud[bot]