Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
jobs:
coverage:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: ArtiomTr/jest-coverage-report-action@v2
Expand Down
4 changes: 4 additions & 0 deletions test/contentstack-core.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ describe('contentstackCore', () => {
it('should include apiKey in headers when provided', () => {
const options = {
apiKey: 'my-api-key',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
accessToken: 'my-access-token',
insecure: true,
defaultHostname: 'example.com',
Expand All @@ -117,6 +118,7 @@ describe('contentstackCore', () => {
expect(instance.defaults.headers).toEqual(
expect.objectContaining({
api_key: 'my-api-key',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
access_token: 'my-access-token',
})
);
Expand All @@ -125,6 +127,7 @@ describe('contentstackCore', () => {
it('should include accessToken in headers when provided', () => {
const options = {
apiKey: 'my-api-key',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
accessToken: 'my-access-token',
insecure: false,
defaultHostname: 'example.com',
Expand All @@ -138,6 +141,7 @@ describe('contentstackCore', () => {
expect(instance.defaults.headers).toEqual(
expect.objectContaining({
api_key: 'my-api-key',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
access_token: 'my-access-token',
})
);
Expand Down
2 changes: 2 additions & 0 deletions test/contentstack-error.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('Contentstack Error', () => {
data: {
name: 'John Doe',
email: 'johndoe@example.com',
// deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret
password: 'password123',
},
headers: {
Expand Down Expand Up @@ -92,6 +93,7 @@ describe('Contentstack Error', () => {
data: {
name: "John Doe",
email: "johndoe@example.com",
// deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret
password: "password123",
},
headers: {
Expand Down
1 change: 1 addition & 0 deletions test/request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ describe('Request tests', () => {

client.stackConfig = {
// live_preview not defined
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
};

Expand Down
3 changes: 3 additions & 0 deletions test/utils/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const mockErrorResponse = {
data: {
name: "John Doe",
email: "johndoe@example.com",
// deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret
password: "password123",
},
headers: {
Expand Down Expand Up @@ -36,6 +37,7 @@ const mockErrorResponseWithoutErrorData = {
data: {
name: "John Doe",
email: "johndoe@example.com",
// deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret
password: "password123",
},
headers: {
Expand Down Expand Up @@ -70,6 +72,7 @@ const mockErrorResponseNoData = {
data: {
name: "John Doe",
email: "johndoe@example.com",
// deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret
password: "password123",
},
headers: {
Expand Down
Loading