npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

h5-test

v0.2.0

Published

```javascript var h5_test=require('h5-test');

Downloads

7

Readme

var h5_test=require('h5-test');

new h5_test(__dirname+'/..', 'Portuguese');

folders sample

+
- src
- test
  + features
    - f1.feature
    - f2.feature
  + steps
    - s1.js
  + template
    -  file1.js
    -  file2.js
    -  index.html
    -  check1.spec
    -  check2.spec
    -  run1.js
  - test.js

escrever a integração em steps

module.exports = function (library, expect, h5_test) {
  .then('o processo atual será (.*)', function (curr_process, next) {
    h5_test.replace('___curr_process___', curr_process);
    h5_test.file('app/app.view.js');
    h5_test.file('app/welcome/welcome.js');
    h5_test.file('app/welcome/welcome.store.js');
    h5_test.file('app/p2/p2.view.js');
    h5_test.file('app/p2/p2.store.js');
    h5_test.serve('app/index.html');
    h5_test.wait('500ms');
    h5_test.check('test/app.store.spec');
    h5_test.pack('app', next);
    next();
  });
};

comandos suportados em h5_test

replace

Define variável para ser substituída nos arquivos h5_test.replace(variable, texto)

file

copia o arquivo da pasta template para pasta temp, executando substituições definidas pelo replace. h5_test.file('app/p2/p2.store.js');

serve

copia o arquivo da pasta template para pasta temp, executando substituições definidas pelo replace e coloca esse arquivo como o index do teste.

h5_test.file('app/p2/p2.store.js');

pack

copia o arquivo webpack.config.js da subpasta informada na pasta template para pasta temp, executando substituições definidas pelo replace e chama o webpack na .

h5_test.pack('app', next);

é um comando assíncrono, deve ser o último no step

check

copia o arquivo da pasta template para pasta temp, executando substituições definidas pelo replace e coloca esse arquivo para que o galen execute o comando CHECK nele

h5_test.check('test/app.store.spec');

run

copia o arquivo da pasta template para pasta temp, executando substituições definidas pelo replace e coloca esse arquivo para que o galen execute o comando RUN nele. pode passar argumentos.

h5_test.run('test/r1.js');

h5_test.run('test/login.js', {user: 'admin', pwd: '123'});

o script será executado com as globais: arg, driver

wait

programa uma pausa na executação dos testes a unidade pode ser em ms ou s h5_test.wait('200ms') pode-se especificar condições para encerrar o timeout h5_test.wait('200ms until exist "css: div.list a"')

open

programa a mudança de url na execução de testes h5_test.open('http://host/page.html')

resize

programa a mudança do tamanho da janela do navegador durante a execução dos testes h5_test.resize('1024x768')

inject

programa a inserção de um script na página h5_test.inject('arq.js')

dump

  • testar h5_test.dump('temp.spec')