Skip to content

Commit

Permalink
fix: assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
ilteoood committed Nov 21, 2024
1 parent 33de7c9 commit 1526755
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/client.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'

const { test, beforeEach, describe } = require('node:test')

const sinon = require('sinon')
const proxyquire = require('proxyquire')

Expand All @@ -23,7 +24,6 @@ beforeEach(() => {

describe('get', (t) => {
test('happy path', async (t) => {

const client = new GcpClient()
accessSecretVersion.resolves([
{
Expand All @@ -35,14 +35,14 @@ describe('get', (t) => {

const secret = await client.get('projects/project-id/secrets/secret-key/versions/latest')

t.ok(accessSecretVersion.called, 'calls accessSecretVersion')
t.ok(
t.assert.ok(accessSecretVersion.called, 'calls accessSecretVersion')
t.assert.ok(
accessSecretVersion.calledWith({
name: 'projects/project-id/secrets/secret-key/versions/latest'
}),
'provides ref as name to accessSecretVersion'
)
t.equal(secret, 'secret payload', 'converts payload.data to sting')
t.assert.equal(secret, 'secret payload', 'converts payload.data to sting')
})

test('sdk error', async (t) => {
Expand All @@ -52,6 +52,6 @@ describe('get', (t) => {

const promise = client.get('projects/project-id/secrets/secret-key/versions/latest')

await t.rejects(promise, 'throws error')
await t.assert.rejects(promise, 'throws error')
})
})

0 comments on commit 1526755

Please sign in to comment.