File tree 2 files changed +46
-0
lines changed
integration-tests/cypress
packages/datadog-plugin-cypress/src
2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,42 @@ moduleTypes.forEach(({
113
113
await receiver . stop ( )
114
114
} )
115
115
116
+ if ( version === '6.7.0' ) {
117
+ // to be removed when we drop support for [email protected]
118
+ it ( 'logs a warning if using a deprecated version of cypress' , ( done ) => {
119
+ let stdout = ''
120
+ const {
121
+ NODE_OPTIONS ,
122
+ ...restEnvVars
123
+ } = getCiVisEvpProxyConfig ( receiver . port )
124
+
125
+ childProcess = exec (
126
+ `${ testCommand } --spec cypress/e2e/spec.cy.js` ,
127
+ {
128
+ cwd,
129
+ env : {
130
+ ...restEnvVars ,
131
+ CYPRESS_BASE_URL : `http://localhost:${ webAppPort } `
132
+ } ,
133
+ stdio : 'pipe'
134
+ }
135
+ )
136
+
137
+ childProcess . stdout . on ( 'data' , ( chunk ) => {
138
+ stdout += chunk . toString ( )
139
+ } )
140
+
141
+ childProcess . on ( 'exit' , ( ) => {
142
+ assert . include (
143
+ stdout ,
144
+ 'WARNING: dd-trace support for Cypress<10.2.0 is deprecated' +
145
+ ' and will not be supported in future versions of dd-trace.'
146
+ )
147
+ done ( )
148
+ } )
149
+ } )
150
+ }
151
+
116
152
it ( 'does not crash if badly init' , ( done ) => {
117
153
const {
118
154
NODE_OPTIONS , // NODE_OPTIONS dd-trace config does not work with cypress
Original file line number Diff line number Diff line change 1
1
const NoopTracer = require ( '../../dd-trace/src/noop/tracer' )
2
2
const cypressPlugin = require ( './cypress-plugin' )
3
+ const satisfies = require ( 'semifies' )
3
4
4
5
const noopTask = {
5
6
'dd:testSuiteStart' : ( ) => {
@@ -19,6 +20,15 @@ const noopTask = {
19
20
module . exports = ( on , config ) => {
20
21
const tracer = require ( '../../dd-trace' )
21
22
23
+ if ( satisfies ( config . version , '<10.2.0' ) ) {
24
+ // console.warn does not seem to work in cypress, so using console.log instead
25
+ // eslint-disable-next-line no-console
26
+ console . log (
27
+ 'WARNING: dd-trace support for Cypress<10.2.0 is deprecated' +
28
+ ' and will not be supported in future versions of dd-trace.'
29
+ )
30
+ }
31
+
22
32
// The tracer was not init correctly for whatever reason (such as invalid DD_SITE)
23
33
if ( tracer . _tracer instanceof NoopTracer ) {
24
34
// We still need to register these tasks or the support file will fail
You can’t perform that action at this time.
0 commit comments