Skip to content

Commit 069467d

Browse files
fix tests
1 parent ec764d1 commit 069467d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/dd-trace/test/config.spec.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ describe('Config', () => {
919919
}
920920
})
921921

922-
expect(log.error).to.be.calledThrice
922+
expect(log.error).to.be.callCount(4)
923923
expect(log.error.firstCall).to.have.been.calledWithExactly(error)
924924
expect(log.error.secondCall).to.have.been.calledWithExactly(error)
925925
expect(log.error.thirdCall).to.have.been.calledWithExactly(error)
@@ -1071,6 +1071,7 @@ describe('Config', () => {
10711071
delete process.env.DD_GIT_PROPERTIES_FILE
10721072
delete process.env.DD_GIT_COMMIT_SHA
10731073
delete process.env.DD_GIT_REPOSITORY_URL
1074+
delete process.env.DD_TRACE_GIT_METADATA_ENABLED
10741075
process.env.DD_TAGS = ddTags
10751076
})
10761077
it('reads DD_GIT_* env vars', () => {
@@ -1120,5 +1121,11 @@ describe('Config', () => {
11201121
expect(config).to.have.property('commitSHA', '4e7da8069bcf5ffc8023603b95653e2dc99d1c7d')
11211122
expect(config).to.have.property('repositoryUrl', 'https://github.com/datadog/dd-trace-js')
11221123
})
1124+
it('does not read git metadata if DD_TRACE_GIT_METADATA_ENABLED is false', () => {
1125+
process.env.DD_TRACE_GIT_METADATA_ENABLED = 'false'
1126+
const config = new Config({})
1127+
expect(config).not.to.have.property('commitSHA')
1128+
expect(config).not.to.have.property('repositoryUrl')
1129+
})
11231130
})
11241131
})

packages/dd-trace/test/serverless.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('Serverless', () => {
6666

6767
// trying to spawn with an invalid path will return a non-descriptive error, so we want to catch
6868
// invalid paths and log our own error.
69-
expect(logErrorSpy).to.have.been.calledOnceWith(
69+
expect(logErrorSpy).to.have.been.calledWith(
7070
'Serverless Mini Agent did not start. Could not find mini agent binary.'
7171
)
7272
existsSyncStub.returns(true)

0 commit comments

Comments
 (0)