How to use the tst.skip function in tst

To help you get started, we’ve selected a few tst examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spectjs / spect / test / index.js View on Github external
function C($el) {
    console.log($el[0])
  }
  console.log($el)
})

t.todo('subselect nodes', t => {
  let $foo = $``

  console.log('bar')
  let $bar = $foo.$(`bar`)

  t.is($bar[0], $foo[0].firstChild)
})

t.skip('live nodes list as reference under the hood', t => {
  // FIXME: that's insustainable for now: we have to extend Spect class from Proxy-ed prototype,
  // providing numeric access to underneath store, like NodeList etc.
  // The proxy prototype looks
  let el = document.createElement('div')

  el.appendChild(document.createElement`div`)

  let $children = $(el.childNodes)
  t.is($children.length, 1)

  el.appendChild(document.createElement`div`)
  t.is($children.length, 2)
})

t.todo('rebinding to other document', async t => {
  let { document } = await import('dom-lite')
github spectjs / spect / test / is.js View on Github external
t.skip('is: simple element with no content should  (?) be upgraded', t => {
  let $el = $`<div is=""> {
    console.log($el)
  }}/&gt;`
})

t.skip('is: existing elements with `is` attr should be hydrated', t =&gt; {
  let $el = $`<div is=""></div>`
  $el.is(FooBar)

  // TODO: and simple tags
  // `<div is=""></div>`

})

t.skip('is: existing element with `is` attr not matching the fn name should throw error', t =&gt; {
  $`<div is="">`.is(FooBar)
})
</div></div>
github spectjs / spect / test / use.js View on Github external
let log = []

  let $a = spect({})
  await $a.use(fn)
  t.is(log, ['x'])
  await $a.use(fn)
  t.is(log, ['x'])
  await $a.use([fn, fn])
  t.is(log, ['x'])
  await $a.update()
  t.is(log, ['x', 'x'])

  function fn(el) { log.push('x') }
})

t.skip('use: same aspect different targets', t =&gt; {
  let log = []
  function fx([el]) {
    log.push(el.tagName)
    // return () =&gt; log.push('destroy ' + el.tagName)
  }

  let $el = spect({ tagName: 'A' }).use(fx)

  t.is($el.target.tagName, log[0])
  t.is(log, ['A'])

  $el.target.innerHTML = '<span></span>'
  $($el.target.firstChild).use(fx)

  t.deepEqual(log, ['A', 'SPAN'])
})
github spectjs / spect / test-legacy / core.js View on Github external
// this
  // args
  $('', () => {

  })
})

t.skip('core: props', t => {
  $('', {})
})

t.skip('core: children', t => {
  $('', a, b, c)
})

t.skip('core: props + children', t => {
  $('', { a, b, c }, a, fn, c)
})

// component tree https://github.com/scrapjs/permanent/issues/2)
t.skip('core: text', t => {
  $(target, 'abc')
})
t.skip('core: Element', t => {
  $(target, Element)
})
t.skip('core: vdom', t => {
  // DO via plugins
  $(target, react | vdom)
})
t.skip('core: class', t => {
  class Component {
github spectjs / spect / test-legacy / core.js View on Github external
})

t.skip('core: props', t => {
  $('', {})
})

t.skip('core: children', t => {
  $('', a, b, c)
})

t.skip('core: props + children', t => {
  $('', { a, b, c }, a, fn, c)
})

// component tree https://github.com/scrapjs/permanent/issues/2)
t.skip('core: text', t => {
  $(target, 'abc')
})
t.skip('core: Element', t => {
  $(target, Element)
})
t.skip('core: vdom', t => {
  // DO via plugins
  $(target, react | vdom)
})
t.skip('core: class', t => {
  class Component {
    constructor() { }
    mount() { }
    update() { }
    unmount() { }
    render() { } // optional
github spectjs / spect / test-legacy / core.js View on Github external
})

t.skip('core: array of elements', t => {
  $([a, b, c], () => {

  })
})

t.skip('core: mixed array', t => {
  $(['.a', b, '.c'], () => {

  })
})

// edge cases
t.skip('core: null target')
t.skip('core: fake target')
github spectjs / spect / test-legacy / core.js View on Github external
t('core: generators aspects')

t('core: async aspects')


// handlers
t.skip('core: function', t => {
  // this
  // args
  $('', () => {

  })
})

t.skip('core: props', t => {
  $('', {})
})

t.skip('core: children', t => {
  $('', a, b, c)
})

t.skip('core: props + children', t => {
  $('', { a, b, c }, a, fn, c)
})

// component tree https://github.com/scrapjs/permanent/issues/2)
t.skip('core: text', t => {
  $(target, 'abc')
})
t.skip('core: Element', t => {
github unihooks / unihooks / test / useChannel.js View on Github external
import t from 'tst'
import enhook from './enhook.js'
import { useChannel, useEffect } from '..'
import { time } from 'wait-please'

t.skip('useChannel: initialize', async t => {
  let log = []

  let a = enhook(() => {
    let [ value, { loading }] = useChannel('charlie')
    log.push('a', value, loading)
  })

  let b = enhook(() => {
    let [ value, { loading }] = useChannel('charlie', 1)
    log.push('b', value, loading)
  })

  let c = enhook(() => {
    let [ value, setValue, { loading }] = useChannel('charlie')
    log.push('c', value, loading)
    useEffect(() => {
github spectjs / spect / test / index.js View on Github external
let $f = $`<form><input name="a"><input name="b"></form>`

  let $form = $($f)

  t.is($f, $form)
  t.is($form[0].childNodes.length, 2)
  t.is($form[0], $f[0])
})

t.skip('array map should work fine', t =&gt; {
  let $a = $`<a>`
  let $b = $a.map(x =&gt; x.html`<span>`)
  t.is($a, $b)
})

t.skip('negative, positive indices')
t.skip('Set methods')
t.skip('call subfilters elements')

t.todo('promise postpones properly / effects are bound', async t =&gt; {
  let $a = $`</span></a><a> html``}/&gt;`

  await $a

  t.is($a[0].innerHTML, '<span class="x"></span>')
})

t.todo('create document fragment is ok', t =&gt; {
  let $d = $(document.createDocumentFragment())

  t.is($d.length, 0)
})</a>
github spectjs / spect / test / html.js View on Github external
let child1 = el.firstChild
  t.equal(child1, child)
  function fn(el) { }
})

t('html: functional components create element', t =&gt; {
  let log = []
  let el = html`&lt;${el =&gt; {
    let e = document.createElement('a')
    log.push(e)
    return e
  }}/&gt;`
  t.is(log, [el])
})

t.skip('html: use assigned via prop', t =&gt; {
  let log = []
  let el = html`<a> {
    log.push(el.tagName.toLowerCase())
    let e = document.createElement('b')
    return e
  }}/&gt;`
  t.is(log, ['a'])
  t.is(el.tagName.toLowerCase(), 'b')
})

t.todo('html: is=string works fine', t =&gt; {
  let a = html`</a><a is="">`
})

t('html: props passed to use are actual object', t =&gt; {
  let a = html``</a>

tst

Tests without efforts

MIT
Latest version published 2 years ago

Package Health Score

46 / 100
Full package analysis