diff --git a/package.json b/package.json index 7c26066..f9ed77d 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "build": "tsc", "build.docs": "typedoc --out docs --mode file src --theme minimal --readme docs.md --media dist", "clean": "shx rm -rf dist", - "test": "jest ", + "test": "jest", + "test.watch": "jest --watch", "commit": "npx git-cz", "semantic-release": "semantic-release" }, diff --git a/src/bind.spec.ts b/src/bind.spec.ts index d504ced..9fcc279 100644 --- a/src/bind.spec.ts +++ b/src/bind.spec.ts @@ -18,13 +18,35 @@ describe('bind', () => { expect(els[0].innerHTML).toEqual(context.html); expect(els[1].innerHTML).toEqual(context.html); - const update ='updated'; + const update = 'updated'; context.html = update; expect(els[0].innerHTML).toEqual(update); expect(els[1].innerHTML).toEqual(update); }); + it('binds attributes when no context property', () => { + document.documentElement.innerHTML = ` +
+ + `; + + const context: any = {}; + + bind(document, context); + + const els = document.querySelectorAll