11import { assert } from '@open-wc/testing'
2- import '../src/index.ts'
2+ import { setCSPTrustedTypesPolicy } from '../src/index.ts'
33
44let count
55const responses = {
@@ -648,13 +648,11 @@ suite('include-fragment-element', function () {
648648
649649 suite ( 'CSP trusted types' , ( ) => {
650650 teardown ( ( ) => {
651- // eslint-disable-next-line no-undef
652651 setCSPTrustedTypesPolicy ( null )
653652 } )
654653
655654 test ( 'can set a pass-through mock CSP trusted types policy' , async function ( ) {
656655 let policyCalled = false
657- // eslint-disable-next-line no-undef
658656 setCSPTrustedTypesPolicy ( {
659657 createHTML : htmlText => {
660658 policyCalled = true
@@ -672,7 +670,6 @@ suite('include-fragment-element', function () {
672670
673671 test ( 'can set and clear a mutating mock CSP trusted types policy' , async function ( ) {
674672 let policyCalled = false
675- // eslint-disable-next-line no-undef
676673 setCSPTrustedTypesPolicy ( {
677674 createHTML : ( ) => {
678675 policyCalled = true
@@ -686,7 +683,6 @@ suite('include-fragment-element', function () {
686683 assert . equal ( '<b>replacement</b>' , data )
687684 assert . ok ( policyCalled )
688685
689- // eslint-disable-next-line no-undef
690686 setCSPTrustedTypesPolicy ( null )
691687 const el2 = document . createElement ( 'include-fragment' )
692688 el2 . src = '/hello'
@@ -703,7 +699,6 @@ suite('include-fragment-element', function () {
703699 return htmlText
704700 }
705701 } )
706- // eslint-disable-next-line no-undef
707702 setCSPTrustedTypesPolicy ( policy )
708703
709704 const el = document . createElement ( 'include-fragment' )
@@ -714,7 +709,6 @@ suite('include-fragment-element', function () {
714709 } )
715710
716711 test ( 'can reject data using a mock CSP trusted types policy' , async function ( ) {
717- // eslint-disable-next-line no-undef
718712 setCSPTrustedTypesPolicy ( {
719713 createHTML : ( ) => {
720714 throw new Error ( 'Rejected data!' )
@@ -732,7 +726,6 @@ suite('include-fragment-element', function () {
732726 } )
733727
734728 test ( 'can access headers using a mock CSP trusted types policy' , async function ( ) {
735- // eslint-disable-next-line no-undef
736729 setCSPTrustedTypesPolicy ( {
737730 createHTML : ( htmlText , response ) => {
738731 if ( response . headers . get ( 'X-Server-Sanitized' ) !== 'sanitized=true' ) {
0 commit comments