Skip to content

Commit

Permalink
remove most usage of get-port for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
rochdev committed Jun 22, 2024
1 parent f29f416 commit 99c19a7
Show file tree
Hide file tree
Showing 18 changed files with 1,461 additions and 1,578 deletions.
13 changes: 7 additions & 6 deletions packages/datadog-plugin-apollo/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const agent = require('../../dd-trace/test/plugins/agent.js')
const { ERROR_MESSAGE, ERROR_TYPE, ERROR_STACK } = require('../../dd-trace/src/constants.js')
const { expectedSchema, rawExpectedSchema } = require('./naming.js')
const axios = require('axios')
const getPort = require('get-port')

const accounts = require('./fixtures.js')

Expand Down Expand Up @@ -86,13 +85,15 @@ describe('Plugin', () => {
gateway: setupGateway(),
subscriptions: false // Disable subscriptions (not supported with Apollo Gateway)
})
getPort().then(newPort => {
port = newPort
startStandaloneServer(server, {
listen: { port }
}).then(() => {})

return startStandaloneServer(server, {
listen: { port: 0 }
}).then(({ url }) => {
port = new URL(url).port
})
})

before(() => {
return agent.load('apollo')
})

Expand Down
Loading

0 comments on commit 99c19a7

Please sign in to comment.