import assert from 'node:assert/strict'; import { isBackForwardCachePortError } from '../webext-bridge/src/internal/port-disconnect'; assert.equal( isBackForwardCachePortError( 'The page keeping the extension port is moved into back/forward cache, so the message channel is closed.', ), true, ); assert.equal(isBackForwardCachePortError('Extension context invalidated.'), false); assert.equal(isBackForwardCachePortError(), false); console.log('Port disconnect tests passed.');