You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/compiler/each-block/_config.js

15 lines
503 B

import * as assert from 'assert';
export default {
data: {
animals: [ 'alpaca', 'baboon', 'capybara' ]
},
html: '<p>alpaca</p><p>baboon</p><p>capybara</p><!--#each animals-->',
test ( component, target ) {
component.set({ animals: [ 'alpaca', 'baboon', 'caribou', 'dogfish' ] });
assert.equal( target.innerHTML, '<p>alpaca</p><p>baboon</p><p>caribou</p><p>dogfish</p><!--#each animals-->' );
component.set({ animals: [] });
assert.equal( target.innerHTML, '<!--#each animals-->' );
}
};