diff --git a/src/index.test.ts b/src/index.test.ts index b8778a9..f38fedb 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,18 +1,27 @@ -import { css, CssIfStringImpl, CssStringImpl } from '.'; +import { + css, + CssIfStringImpl, + CssStringImpl, + setup, + extractCss, +} from '.'; import { vi, describe, it, expect, } from 'vitest'; +import { setup as setupGoober, extractCss as extractCssGoober } from 'goober'; vi.mock('goober', () => { return { css: () => 'gooberClass', + setup: vi.fn(), + extractCss: vi.fn(), }; }); -describe('css-utils', () => { +describe('@tesseract-design/goofy-goober', () => { describe('css', () => { it('should return CssString', () => { const c = css` @@ -140,4 +149,22 @@ describe('css-utils', () => { ).toBe('class1 class2 gooberClass'); }) }) -}) + + describe('setup', () => { + it('should call setup from goober', () => { + const pragma = vi.fn(); + const prefixer = vi.fn(); + setup(pragma, prefixer); + + expect(setupGoober).toHaveBeenCalledWith(pragma, prefixer); + }) + }); + + describe('extractCss', () => { + it('should call extractCss from goober', () => { + extractCss(); + + expect(extractCssGoober).toHaveBeenCalled(); + }) + }); +}); diff --git a/tsconfig.json b/tsconfig.json index 4ae90a1..8973956 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "moduleResolution": "node", - "jsx": "react", + "jsx": "react-jsx", "esModuleInterop": true, "target": "ES2017" }