Odoo GraphQL Subscription using Node, Express JS for Sample
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
1.9 KiB

4 months ago
{"version":3,"file":"toBeDisposed.js","sourceRoot":"","sources":["../../../src/testing/matchers/toBeDisposed.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,cAAc,GACf,MAAM,+BAA+B,CAAC;AAEvC,SAAS,UAAU,CAAC,QAAiB;IACnC,IAAI,CAAC;QACH,OAAO,cAAc,CAAC,QAAe,CAAC,YAAY,sBAAsB,CAAC;IAC3E,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,CAAC,IAAM,YAAY,GAAwB,UAAU,QAAQ;IAAlB,iBAmBhD;IAlBC,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,cAAc,EAAE,UAAU,EAAE,EAAE,EAAE;QAClE,KAAK,EAAE,IAAI,CAAC,KAAK;KAClB,CAAC,CAAC;IAEH,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,YAAK,IAAI,mDAAgD,CAAC,CAAC;IAC7E,CAAC;IAED,IAAM,IAAI,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;IAE/C,OAAO;QACL,IAAI,MAAA;QACJ,OAAO,EAAE;YACP,OAAO,UAAG,IAAI,mCACZ,KAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,uCACG,KAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,MAAG,CAAC;QAC3D,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { MatcherFunction } from \"expect\";\nimport type { QueryReference } from \"../../react/internal/index.js\";\nimport {\n InternalQueryReference,\n unwrapQueryRef,\n} from \"../../react/internal/index.js\";\n\nfunction isQueryRef(queryRef: unknown): queryRef is QueryReference {\n try {\n return unwrapQueryRef(queryRef as any) instanceof InternalQueryReference;\n } catch (e) {\n return false;\n }\n}\n\nexport const toBeDisposed: MatcherFunction<[]> = function (queryRef) {\n const hint = this.utils.matcherHint(\"toBeDisposed\", \"queryRef\", \"\", {\n isNot: this.isNot,\n });\n\n if (!isQueryRef(queryRef)) {\n throw new Error(`\\n${hint}\\n\\nmust be called with a valid QueryReference`);\n }\n\n const pass = unwrapQueryRef(queryRef).disposed;\n\n return {\n pass,\n message: () => {\n return `${hint}\\n\\nExpected queryRef ${\n this.isNot ? \"not \" : \"\"\n }to be disposed, but it was${this.isNot ? \"\" : \" not\"}.`;\n },\n };\n};\n"]}