Skip to content

Commit

Permalink
add a test file for live-code
Browse files Browse the repository at this point in the history
  • Loading branch information
trusktr committed Oct 1, 2024
1 parent 010fbfb commit 439fbe4
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 1 deletion.
5 changes: 5 additions & 0 deletions dist/LiveCode.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare global {
const expect: any;
}
export {};
//# sourceMappingURL=LiveCode.test.d.ts.map
1 change: 1 addition & 0 deletions dist/LiveCode.test.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions dist/LiveCode.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/LiveCode.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions lume.config.cjs
Original file line number Diff line number Diff line change
@@ -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',

// <code-mirror> 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',
},
},
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 14 additions & 0 deletions src/LiveCode.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {LiveCode} from './LiveCode.js'

declare global {
const expect: any
}

describe('<live-code>', () => {
it('is a custom element', () => {
const editor = document.createElement('live-code')
expect(editor instanceof LiveCode).toBe(true)
})

// ... TODO ...
})

0 comments on commit 439fbe4

Please sign in to comment.