From 439fbe4f5f610d54603bb32616ec65f430d75b92 Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Mon, 30 Sep 2024 19:31:35 -0700 Subject: [PATCH] add a test file for live-code --- dist/LiveCode.test.d.ts | 5 ++++ dist/LiveCode.test.d.ts.map | 1 + dist/LiveCode.test.js | 9 ++++++++ dist/LiveCode.test.js.map | 1 + lume.config.cjs | 46 +++++++++++++++++++++++++++++++++++++ package.json | 3 ++- src/LiveCode.test.ts | 14 +++++++++++ 7 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 dist/LiveCode.test.d.ts create mode 100644 dist/LiveCode.test.d.ts.map create mode 100644 dist/LiveCode.test.js create mode 100644 dist/LiveCode.test.js.map create mode 100644 lume.config.cjs create mode 100644 src/LiveCode.test.ts diff --git a/dist/LiveCode.test.d.ts b/dist/LiveCode.test.d.ts new file mode 100644 index 0000000..fc2f090 --- /dev/null +++ b/dist/LiveCode.test.d.ts @@ -0,0 +1,5 @@ +declare global { + const expect: any; +} +export {}; +//# sourceMappingURL=LiveCode.test.d.ts.map \ No newline at end of file diff --git a/dist/LiveCode.test.d.ts.map b/dist/LiveCode.test.d.ts.map new file mode 100644 index 0000000..a990acb --- /dev/null +++ b/dist/LiveCode.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LiveCode.test.d.ts","sourceRoot":"","sources":["../src/LiveCode.test.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,CAAC;IACd,MAAM,MAAM,EAAE,GAAG,CAAA;CACjB"} \ No newline at end of file diff --git a/dist/LiveCode.test.js b/dist/LiveCode.test.js new file mode 100644 index 0000000..470a3c0 --- /dev/null +++ b/dist/LiveCode.test.js @@ -0,0 +1,9 @@ +import { LiveCode } from './LiveCode.js'; +describe('', () => { + it('is a custom element', () => { + const editor = document.createElement('live-code'); + expect(editor instanceof LiveCode).toBe(true); + }); + // ... TODO ... +}); +//# sourceMappingURL=LiveCode.test.js.map \ No newline at end of file diff --git a/dist/LiveCode.test.js.map b/dist/LiveCode.test.js.map new file mode 100644 index 0000000..0e438fd --- /dev/null +++ b/dist/LiveCode.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LiveCode.test.js","sourceRoot":"","sources":["../src/LiveCode.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAA;AAMtC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE;QAC9B,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,CAAA;QAClD,MAAM,CAAC,MAAM,YAAY,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC,CAAC,CAAA;IAEF,eAAe;AAChB,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/lume.config.cjs b/lume.config.cjs new file mode 100644 index 0000000..4c0050f --- /dev/null +++ b/lume.config.cjs @@ -0,0 +1,46 @@ +/** @type {import('@lume/cli/config/getUserConfig.js').UserConfig} */ +module.exports = { + importMap: { + imports: { + // lume stuff + '@lume/element': '/node_modules/@lume/element/dist/index.js', + 'classy-solid': '/node_modules/classy-solid/dist/index.js', + '@lume/eventful': '/node_modules/@lume/eventful/dist/index.js', + lowclass: '/node_modules/lowclass/dist/index.js', + 'lowclass/': '/node_modules/lowclass/', + 'solid-js': '/node_modules/solid-js/dist/solid.js', + 'solid-js/web': '/node_modules/solid-js/web/dist/web.js', + 'solid-js/html': '/node_modules/solid-js/html/dist/html.js', + 'solid-js/store': '/node_modules/solid-js/store/dist/store.js', + + // stuff + 'code-mirror-el': '/node_modules/code-mirror-el/dist/index.js', + '@babel/runtime/helpers/extends': '/node_modules/@babel/runtime/helpers/esm/extends.js', + '@codemirror/autocomplete': '/node_modules/@codemirror/autocomplete/dist/index.js', + '@codemirror/commands': '/node_modules/@codemirror/commands/dist/index.js', + '@codemirror/lang-css': '/node_modules/@codemirror/lang-css/dist/index.js', + '@codemirror/lang-html': '/node_modules/@codemirror/lang-html/dist/index.js', + '@codemirror/lang-javascript': '/node_modules/@codemirror/lang-javascript/dist/index.js', + '@codemirror/language': '/node_modules/@codemirror/language/dist/index.js', + '@codemirror/lint': '/node_modules/@codemirror/lint/dist/index.js', + '@codemirror/search': '/node_modules/@codemirror/search/dist/index.js', + '@codemirror/state': '/node_modules/@codemirror/state/dist/index.js', + '@codemirror/theme-one-dark': '/node_modules/@codemirror/theme-one-dark/dist/index.js', + '@codemirror/view': '/node_modules/@codemirror/view/dist/index.js', + '@lezer/common': '/node_modules/@lezer/common/dist/index.js', + '@lezer/css': '/node_modules/@lezer/css/dist/index.js', + '@lezer/highlight': '/node_modules/@lezer/highlight/dist/index.js', + '@lezer/html': '/node_modules/@lezer/html/dist/index.js', + '@lezer/javascript': '/node_modules/@lezer/javascript/dist/index.js', + '@lezer/lr': '/node_modules/@lezer/lr/dist/index.js', + '@uiw/codemirror-theme-noctis-lilac': '/node_modules/@uiw/codemirror-theme-noctis-lilac/esm/index.js', + '@uiw/codemirror-themes': '/node_modules/@uiw/codemirror-themes/esm/index.js', + codemirror: '/node_modules/codemirror/dist/index.js', + crelt: '/node_modules/crelt/index.js', + 'lodash-es/': '/node_modules/lodash-es/', + 'style-mod': '/node_modules/style-mod/src/style-mod.js', + 'thememirror/': '/node_modules/thememirror/', + 'w3c-keyname': '/node_modules/w3c-keyname/index.js', + }, + }, +} diff --git a/package.json b/package.json index de6a871..02a04b2 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "build": "lume build", "clean": "lume clean", "examples": "five-server .", - "test": "npm run prettier:check", + "test": "lume test", + "test:watch": "lume test --watch", "prettier": "prettier . --write", "prettier:check": "prettier . --check", "version": "npm test", diff --git a/src/LiveCode.test.ts b/src/LiveCode.test.ts new file mode 100644 index 0000000..ca2bd31 --- /dev/null +++ b/src/LiveCode.test.ts @@ -0,0 +1,14 @@ +import {LiveCode} from './LiveCode.js' + +declare global { + const expect: any +} + +describe('', () => { + it('is a custom element', () => { + const editor = document.createElement('live-code') + expect(editor instanceof LiveCode).toBe(true) + }) + + // ... TODO ... +})