-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pact] feat: Adding initial contract test
- Loading branch information
1 parent
8200c6b
commit c0db62b
Showing
11 changed files
with
2,941 additions
and
44 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import path from 'path'; | ||
import { Verifier } from '@pact-foundation/pact'; | ||
import { test, describe, vi, beforeAll } from 'vitest'; | ||
import { log } from 'console'; | ||
|
||
describe('Pact Verification', () => { | ||
test('verifies the pact', async () => { | ||
const opts = { | ||
customProviderHeaders: ['Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjY2Y4OWE3ZS1iOTQxLTRmMTctYmJlMC00ZTBjOGIyY2QyNzIiLCJpYXQiOjE3MTY0OTQ1OTYsImV4cCI6MjAzMjA3MDU5Nn0.jaUro5w3tCbQUf8jGno_tcH2-K9li0dTAksBQX-YUyk'], | ||
provider: 'NotesBEService', | ||
providerBaseUrl: 'http://localhost:5000', | ||
pactUrls: [path.resolve(__dirname, '../../../frontend/pacts/NotesFEService-NotesBEService.json')], // path to your Pact file | ||
log: 'INFO', // Set to "DEBUG" to see output | ||
}; | ||
|
||
return new Verifier(opts).verifyProvider().then(output => { | ||
console.log(output); | ||
}); | ||
}); | ||
} | ||
); |
Oops, something went wrong.