Netflix / x-element

A dead simple starting point for custom elements.
Apache License 2.0
29 stars 12 forks source link

Puppeteer tests seem to no longer work when run locally. #167

Closed theengineear closed 9 months ago

theengineear commented 9 months ago

When trying to run tests locally via npm test, I am currently getting the following:

ProtocolError: Protocol error (Runtime.callFunctionOn): Execution context was destroyed.
    at <instance_members_initializer> (file:///Users/aseier@netflix.com/WebstormProjects/x-element/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:92:14)
    at new Callback (file:///Users/aseier@netflix.com/WebstormProjects/x-element/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:96:16)
    at CallbackRegistry.create (file:///Users/aseier@netflix.com/WebstormProjects/x-element/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:19:26)
    at Connection._rawSend (file:///Users/aseier@netflix.com/WebstormProjects/x-element/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Connection.js:77:26)
    at CdpCDPSession.send (file:///Users/aseier@netflix.com/WebstormProjects/x-element/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/CDPSession.js:63:33)
    at #evaluate (file:///Users/aseier@netflix.com/WebstormProjects/x-element/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:199:50)
    at ExecutionContext.evaluate (file:///Users/aseier@netflix.com/WebstormProjects/x-element/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:114:36)
    at IsolatedWorld.evaluate (file:///Users/aseier@netflix.com/WebstormProjects/x-element/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/IsolatedWorld.js:121:30)
    at CdpFrame.evaluate (file:///Users/aseier@netflix.com/WebstormProjects/x-element/node_modules/puppeteer-core/lib/esm/puppeteer/api/Frame.js:350:43)
    at CdpFrame.<anonymous> (file:///Users/aseier@netflix.com/WebstormProjects/x-element/node_modules/puppeteer-core/lib/esm/puppeteer/util/decorators.js:94:27)
TAP version 14
1..0 # no tests found
✨  Done in 0.77s.

There are two problems here:

  1. This should not result in successful (0) command exit which hides the problem from tooling.
  2. The tests seem to not actually run at this point, so we need to fix that.

Mostly (2) is the thing that needs to be fixed.

theengineear commented 9 months ago

FYI @klebba — not sure if any of the recent version bumps / changes may have caused this.

klebba commented 9 months ago

Can you include your node & npm versions?

klebba commented 9 months ago

This appears to be related to server.js not knowing what to do with http://127.0.0.1:8080/test/?x-test-run-coverage — it's confused by the query param. Easy fix!