can-dom-mutate
Advanced tools
Comparing version 1.3.6 to 1.3.7
@module {{}} can-dom-mutate | ||
@parent can-dom-utilities | ||
@collection can-infrastructure | ||
@package ./package.json | ||
@@ -5,0 +6,0 @@ @description Dispatch and listen for DOM mutations. |
@@ -11,3 +11,3 @@ var unit = require('steal-qunit'); | ||
testUtils.moduleWithMutationObserver('can-dom-mutate/dom-events', function () { | ||
test('inserted', function (assert) { | ||
QUnit.test('inserted', function (assert) { | ||
var done = assert.async(); | ||
@@ -14,0 +14,0 @@ var fixture = testUtils.getFixture(); |
@@ -19,3 +19,3 @@ var unit = require('steal-qunit'); | ||
moduleWithMutationObserver('can-dom-mutate/node', function () { | ||
test('appendChild should not call domMutate.dispatchNodeInsertion', function (assert) { | ||
QUnit.test('appendChild should not call domMutate.dispatchNodeInsertion', function (assert) { | ||
var parent = testUtils.getFixture(); | ||
@@ -31,3 +31,3 @@ var child = document.createElement('div'); | ||
test('insertBefore should not call domMutate.dispatchNodeInsertion', function (assert) { | ||
QUnit.test('insertBefore should not call domMutate.dispatchNodeInsertion', function (assert) { | ||
var parent = testUtils.getFixture(); | ||
@@ -45,3 +45,3 @@ var sibling = document.createElement('span'); | ||
test('removeChild should not call domMutate.dispatchNodeRemoval', function (assert) { | ||
QUnit.test('removeChild should not call domMutate.dispatchNodeRemoval', function (assert) { | ||
var parent = testUtils.getFixture(); | ||
@@ -58,3 +58,3 @@ var child = document.createElement('div'); | ||
test('replaceChild should not call domMutate.dispatchNodeRemoval+Insertion', function (assert) { | ||
QUnit.test('replaceChild should not call domMutate.dispatchNodeRemoval+Insertion', function (assert) { | ||
var parent = testUtils.getFixture(); | ||
@@ -75,3 +75,3 @@ var sibling = document.createElement('span'); | ||
test('setAttribute should not call domMutate.dispatchNodeAttributeChange', function (assert) { | ||
QUnit.test('setAttribute should not call domMutate.dispatchNodeAttributeChange', function (assert) { | ||
var element = document.createElement('div'); | ||
@@ -86,3 +86,3 @@ var undo = neverCall(assert, domMutate, 'dispatchNodeAttributeChange'); | ||
test('removeAttribute should not call domMutate.dispatchNodeAttributeChange', function (assert) { | ||
QUnit.test('removeAttribute should not call domMutate.dispatchNodeAttributeChange', function (assert) { | ||
var element = document.createElement('div'); | ||
@@ -101,3 +101,3 @@ var undo = neverCall(assert, domMutate, 'dispatchNodeAttributeChange'); | ||
moduleWithoutMutationObserver('can-dom-mutate/node', function () { | ||
test('appendChild should call domMutate.dispatchNodeInsertion', function (assert) { | ||
QUnit.test('appendChild should call domMutate.dispatchNodeInsertion', function (assert) { | ||
var done = assert.async(); | ||
@@ -143,3 +143,3 @@ var parent = testUtils.getFixture(); | ||
test('appendChild should dispatch fragment children to dispatchNodeInserted', function (assert) { | ||
QUnit.test('appendChild should dispatch fragment children to dispatchNodeInserted', function (assert) { | ||
assert.expect(2); | ||
@@ -152,3 +152,3 @@ var parent = testUtils.getFixture(); | ||
test('insertBefore should call domMutate.dispatchNodeInsertion', function (assert) { | ||
QUnit.test('insertBefore should call domMutate.dispatchNodeInsertion', function (assert) { | ||
var done = assert.async(); | ||
@@ -171,3 +171,3 @@ var parent = testUtils.getFixture(); | ||
test('insertBefore should dispatch fragment children to dispatchNodeInserted', function (assert) { | ||
QUnit.test('insertBefore should dispatch fragment children to dispatchNodeInserted', function (assert) { | ||
assert.expect(2); | ||
@@ -183,3 +183,3 @@ var parent = testUtils.getFixture(); | ||
test('removeChild should call domMutate.dispatchNodeRemoval', function (assert) { | ||
QUnit.test('removeChild should call domMutate.dispatchNodeRemoval', function (assert) { | ||
var done = assert.async(); | ||
@@ -201,3 +201,3 @@ var parent = testUtils.getFixture(); | ||
test('replaceChild should call domMutate.dispatchNodeRemoval+Insertion', function (assert) { | ||
QUnit.test('replaceChild should call domMutate.dispatchNodeRemoval+Insertion', function (assert) { | ||
var done = assert.async(); | ||
@@ -230,3 +230,3 @@ var parent = testUtils.getFixture(); | ||
test('replaceChild should dispatch fragment children to dispatchNodeInserted', function (assert) { | ||
QUnit.test('replaceChild should dispatch fragment children to dispatchNodeInserted', function (assert) { | ||
assert.expect(3); | ||
@@ -248,3 +248,3 @@ var parent = testUtils.getFixture(); | ||
test('setAttribute should call domMutate.dispatchNodeAttributeChange', function (assert) { | ||
QUnit.test('setAttribute should call domMutate.dispatchNodeAttributeChange', function (assert) { | ||
var done = assert.async(); | ||
@@ -267,3 +267,3 @@ var element = document.createElement('div'); | ||
test('removeAttribute should call domMutate.dispatchNodeAttributeChange', function (assert) { | ||
QUnit.test('removeAttribute should call domMutate.dispatchNodeAttributeChange', function (assert) { | ||
var done = assert.async(); | ||
@@ -301,3 +301,3 @@ var element = document.createElement('div'); | ||
test('appendChild should not call dispatchNodeInsertion', function (assert) { | ||
QUnit.test('appendChild should not call dispatchNodeInsertion', function (assert) { | ||
assert.expect(0); | ||
@@ -314,3 +314,3 @@ var fragment = document.createDocumentFragment(); | ||
test('insertBefore should not call dispatchNodeInsertion', function (assert) { | ||
QUnit.test('insertBefore should not call dispatchNodeInsertion', function (assert) { | ||
assert.expect(0); | ||
@@ -330,3 +330,3 @@ var fragment = document.createDocumentFragment(); | ||
test('removeChild should not call dispatchNodeRemoval', function (assert) { | ||
QUnit.test('removeChild should not call dispatchNodeRemoval', function (assert) { | ||
assert.expect(0); | ||
@@ -345,3 +345,3 @@ var fragment = document.createDocumentFragment(); | ||
test('replaceChild should not call dispatchNodeRemoval+Insertion', function (assert) { | ||
QUnit.test('replaceChild should not call dispatchNodeRemoval+Insertion', function (assert) { | ||
assert.expect(0); | ||
@@ -365,3 +365,3 @@ var fragment = document.createDocumentFragment(); | ||
test('removeChild on the documentElement', function(assert) { | ||
QUnit.test('removeChild on the documentElement', function(assert) { | ||
var done = assert.async(); | ||
@@ -368,0 +368,0 @@ var doc1 = document.implementation.createHTMLDocument('doc1'); |
{ | ||
"name": "can-dom-mutate", | ||
"description": "Dispatch and listen for DOM mutations", | ||
"version": "1.3.6", | ||
"version": "1.3.7", | ||
"author": { | ||
@@ -23,5 +23,5 @@ "name": "DoneJS Team", | ||
"steal": "^1.3.1", | ||
"steal-qunit": "^1.0.1", | ||
"steal-qunit": "^2.0.0", | ||
"steal-tools": "^1.2.0", | ||
"testee": "^0.8.0" | ||
"testee": "^0.9.0" | ||
}, | ||
@@ -28,0 +28,0 @@ "homepage": "https://github.com/canjs/can-dom-mutate", |
# can-dom-mutate | ||
> Dispatch and listen for DOM mutations | ||
```sh | ||
npm install can-dom-mutate | ||
``` | ||
[![npm](https://img.shields.io/npm/v/can-dom-mutate.svg)](https://www.npmjs.com/package/can-dom-mutate) | ||
[![Join our Slack](https://img.shields.io/badge/slack-join%20chat-611f69.svg)](https://www.bitovi.com/community/slack?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![Join our Discourse](https://img.shields.io/discourse/https/forums.bitovi.com/posts.svg)](https://forums.bitovi.com/?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/canjs/can-dom-mutate/blob/master/LICENSE) | ||
[![npm version](https://badge.fury.io/js/can-dom-mutate.svg)](https://www.npmjs.com/package/can-dom-mutate) | ||
[![Travis build status](https://travis-ci.org/canjs/can-dom-mutate.svg?branch=master)](https://travis-ci.org/canjs/can-dom-mutate) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/canjs/can-dom-mutate.svg)](https://greenkeeper.io/) | ||
[![Build Status](https://travis-ci.org/canjs/can-dom-mutate.svg?branch=master)](https://travis-ci.org/canjs/can-dom-mutate) | ||
## Usage | ||
Dispatch and listen for DOM mutations. | ||
### ES6 use | ||
## Documentation | ||
With StealJS, you can import this module directly in a template that is autorendered: | ||
Read the [can-dom-mutate API docs on CanJS.com](https://canjs.com/doc/can-dom-mutate.html). | ||
```js | ||
import domMutate from "can-dom-mutate"; | ||
``` | ||
## Changelog | ||
### CommonJS use | ||
See the [latest releases on GitHub](https://github.com/canjs/can-dom-mutate/releases). | ||
Use `require` to load `can-dom-mutate` and everything else | ||
needed to create a template that uses `can-dom-mutate`: | ||
## Contributing | ||
```js | ||
import domMutate from "can-dom-mutate"; | ||
``` | ||
The [contribution guide](https://github.com/canjs/can-dom-mutate/blob/master/CONTRIBUTING.md) has information on getting help, reporting bugs, developing locally, and more. | ||
### Standalone use | ||
## License | ||
Load the `global` version of the plugin: | ||
```html | ||
<script src='./node_modules/can-dom-mutate/dist/global/can-dom-mutate.js'></script> | ||
``` | ||
[MIT](https://github.com/canjs/can-dom-mutate/blob/master/LICENSE) |
@@ -188,3 +188,4 @@ var unit = require('steal-qunit'); | ||
test('changing the MutationObserver tears down the mutation observer', 2, function (assert) { | ||
test('changing the MutationObserver tears down the mutation observer', function (assert) { | ||
assert.expect(2); | ||
var done = assert.async(); | ||
@@ -195,3 +196,3 @@ var parent = testUtils.getFixture(); | ||
var undoA = domMutate.onNodeInsertion(wrapper, function () { | ||
QUnit.ok(true, "this will still be called b/c it's on the document"); | ||
assert.ok(true, "this will still be called b/c it's on the document"); | ||
undoA(); | ||
@@ -198,0 +199,0 @@ }); |
@@ -16,6 +16,6 @@ var unit = require('steal-qunit'); | ||
var hooks = { | ||
setup: function () { | ||
beforeEach: function () { | ||
globals.setKeyValue(mutationObserverKey, null); | ||
}, | ||
teardown: function () { | ||
afterEach: function () { | ||
globals.deleteKeyValue(mutationObserverKey); | ||
@@ -22,0 +22,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61797
1400
27