Skip to content

Commit

Permalink
infra: lume cli update: update tests to run in @web/test-runner (repl…
Browse files Browse the repository at this point in the history
…aced Karma in lume cli), update GitHub Actions yml to run clean/build/test separately as they are no longer coupled in lume cli, update build output with changes from the updated target:esnext option in lume cli tsconfig. Note, the dev process in the repo, when standalone and not a git submodule in the lume repo, will not work for now and needs to be developed as part of the lume supermodule repo using the link script for bootstrapping and linking of packages. Once we finish the stage-3-decorators and classy-solid migration in Lume (soon) we will get the lume cli working in standalone repos again.
  • Loading branch information
trusktr committed Oct 30, 2023
1 parent 4b9d6b4 commit 4bea32b
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
- name: npm install, build, and test
run: |
npm i
npm run clean
npm run build
npm test
- name: ensure no modifications
run: git add . && git diff --quiet && git diff --cached --quiet
env:
CI: true
3 changes: 3 additions & 0 deletions dist/Mixin.test.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
declare global {
function expect(...args: any[]): any;
}
export {};
//# sourceMappingURL=Mixin.test.d.ts.map
2 changes: 1 addition & 1 deletion dist/Mixin.test.d.ts.map

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

2 changes: 1 addition & 1 deletion dist/Mixin.test.js.map

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

5 changes: 3 additions & 2 deletions dist/tests/basics.test.js

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

2 changes: 1 addition & 1 deletion dist/tests/basics.test.js.map

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports COMMENT:": "This removes 'dist' from import statements, as well as replaces the 'main' field. See https://github.com/nodejs/node/issues/14970#issuecomment-571887546",
"exports": {
".": "./dist/index.js",
"./": "./dist/"
},
"scripts": {
"LUME SCRIPTS XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX": "",
"clean": "lume clean",
Expand All @@ -21,7 +16,7 @@
"typecheck": "lume typecheck",
"typecheck:watch": "lume typecheckWatch",
"test": "lume test",
"test:debug": "lume testDebug",
"test:watch": "lume test --watch",
"prettier": "lume prettier",
"prettier:check": "lume prettierCheck",
"release:patch": "lume releasePatch",
Expand Down
6 changes: 6 additions & 0 deletions src/Mixin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import Mixin, {HasInstance, MixinResult} from './Mixin.js'
import instanceOf from './instanceOf.js'
import {Constructor} from './utils.js'

// TODO move type def to @lume/cli, map @types/jest's `expect` type into the
// global env.
declare global {
function expect(...args: any[]): any
}

describe('Mixin', () => {
it('Mixin returns a Function', () => {
// const Foo = Mixin(Base => class Foo extends Constructor(Base || Object) {})
Expand Down
7 changes: 3 additions & 4 deletions src/tests/basics.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Class, InvalidAccessError, InvalidSuperAccessError} from '../index.js'

import {native} from '../native.js'
import {spy} from 'sinon'

const test = it

Expand Down Expand Up @@ -806,8 +806,7 @@ describe('basics', () => {
})

test('valid vs invalid Super access', () => {
//const verifyDimensionCall = jest.fn()
const verifyDimensionCall = jasmine.createSpy()
const verifyDimensionCall = spy()

// PhysicalObject implicitly extends from Object (no pun intended!):
const PhysicalObject = Class({
Expand Down Expand Up @@ -883,7 +882,7 @@ describe('basics', () => {
const oboe = new Oboe()

oboe.testFromInstrumentClass()
expect(verifyDimensionCall).toHaveBeenCalled()
expect(verifyDimensionCall.called).toBe(true)

expect(oboe.testFromOboeClass()).toBe('wooo')
})
Expand Down

0 comments on commit 4bea32b

Please sign in to comment.