{"name":"testling","version":"1.7.2","keywords":["test","browser","headless"],"author":{"url":"http://substack.net","name":"James Halliday","email":"mail@substack.net"},"license":"MIT/X11","_id":"testling@1.7.2","maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"},{"name":"substack","email":"substack@gmail.com"}],"homepage":"https://github.com/substack/testling#readme","bugs":{"url":"https://github.com/substack/testling/issues"},"bin":{"testling":"bin/cmd.js"},"dist":{"shasum":"39902563a30bd7783a5266204ad1235392bd5226","tarball":"http://registry-npm.ywwl.com/testling/download/testling-1.7.2.tgz","fileCount":9,"integrity":"sha512-6WiZ76Z1v/SXjvQcskqwa7OaLqDEsvdTi+syqWcWD9KmedtzmHuSxE7mNbk3HqU1t57EzteGhOs4bW75FcAWOA==","signatures":[{"sig":"MEUCIAQKXDursofpdgPbldaIQP0q1q4bQ89uhTi9zUBlsOliAiEAglrd6PBsuV645+0QqEi527EIbCchA6XtXcFamOdRZiI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeG5JYCRA9TVsSAnZWagAAm1EP/A7pza5oIkwR0r7Swgo/\nrtr3Vx+ZAxAMsrgaqMtLg265R8YmEzUWdu3cm7JHQUGQF+9tsOJw3Iw+bKmy\nAZe27YByVv5SQxyoxoYLIn0hxEtQflqxY8iIL/yP/2tvw7GW7B3aprcdR3TE\niG6P3ai9U3vt7jnRPCFdOlsQw22nTIs2qdFkELU03pDXyPkjKhDLxVghbBoX\n9xHArkmDidYJx268TM1w5Ho2+0CrchxVwlNwE8mwb2dKleTLO4kBc2yFfBmD\ne1+CZTsvB4m2pxA4qBPj859YrCOAtZNO8H3+FlywF1UmEWOwbhr5yOXIKZ3x\nMReYjlNiv+Fk5BhtFcwrEYd5EUqE+x3M4M8L/ly4zF339V16Pdy9s4gx+r/9\nY7bLKWzRf/VWSSsx2zEBXGmML+8csyInAqmTj1Ig+KPFpJPsW9B4lrwg69/V\npDSkVKmFO0GDmj5DrTC0UUdTHFWMv0fjV2Ko+eeRGzsHQrtfGgSNhb1z27uq\nFsQ82+Xd2wLokFs7eXZuxZqDWtsH+0oB9Y74hAOo+K1nlEX2sFAWDdap32QS\nA9pJkxwWX5COf+cJHeLFCsK3hIVHugl7cPIqG/oS56OemV3mKzrn/pCjWR9A\nRl+G7KvqPEp/QkAylpbYWJIAWZoZuGpKfHgd38xPUrX6SD5Nk25nzuuO+B3Z\nBdN+\r\n=SvJI\r\n-----END PGP SIGNATURE-----\r\n","size":8535,"noattachment":false,"key":"/testling/-/testling-1.7.2.tgz"},"engines":{"node":">=0.6"},"gitHead":"0b779335157e8009887524dae2fc47cb91846ed7","scripts":{"build":"mkdir -p bundle && browserify browser/prelude.js -o bundle/prelude.js","prebuild":"rimraf bundle","prepublish":"safe-publish-latest && npm run build"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"browserify":"browser.js","repository":{"url":"git://github.com/substack/testling.git","type":"git"},"_npmVersion":"6.13.4","description":"write tests for browser code","directories":{},"_nodeVersion":"13.6.0","dependencies":{"ent":"~0.0.7","glob":"~3.2.11","bouncy":"~3.2.2","jsonify":"~0.0.0","resolve":"~1.14.2","ecstatic":"~0.4.13","optimist":"~0.5.2","win-spawn":"~2.0.0","browserify":"3.x.x","shell-quote":"~1.7.2","shallow-copy":"~0.0.1","tap-finished":"~0.0.1","concat-stream":"~1.0.1","object-inspect":"~1.7.0","browser-launcher":"~1.0.1","xhr-write-stream":"~0.1.2"},"_hasShrinkwrap":false,"devDependencies":{"tape":"~5.0.0-next.3","rimraf":"~3.0.0","safe-publish-latest":"~1.1.4"},"_npmOperationalInternal":{"tmp":"tmp/testling_1.7.2_1578865239667_0.23471974645931826","host":"s3://npm-registry-packages"},"readme":"# testling\n\nRun [testling-ci](http://ci.testling.com) tests locally.\n\n# example\n\nwrite a test:\n\n``` js\nvar test = require('tape');\n\ntest('beep boop', function (t) {\n    t.plan(2);\n    t.equal(1+1, 2);\n    t.ok(true);\n});\n```\n\nrun your test in a local headless browser:\n\n```\n$ browserify example/test.js | testling\n\nTAP version 13\n# beep boop\nok 1 should be equal\nok 2 (unnamed assert)\n\n1..2\n# tests 2\n# pass  2\n\n# ok\n```\n\nwith an exit code of 0 for successes and non-zero for failures like a good unix\ncitizen\n\nOnce you have a `package.json` with a configured `\"testling\"` field, you can just\ntype:\n\n```\n$ testling\n```\n\nto run all your tests locally just like they will be run on\n[testling-ci](https://ci.testling.com). This includes mocha harnesses, scripts,\nand files parameters.\n\n# usage\n\n```\nusage: testling {DIRECTORY|-} {OPTIONS}\n\nIf there (is no DIRECTORY and stdin is a tty) or the DIRECTORY is \"-\",\njavascript will be read from stdin and executed.\n\nOtherwise, DIRECTORY (or the $CWD) will be checked for a package.json with a\ntestling field.\n\nOPTIONS are:\n\n     --html  Instead of launching a server, show the generated html.\n\n  --no-show  Don't render the console.log() output to the document body.\n\n         -u  Instead of launching a browser, print the url to visit so you can\n             open the browser yourself.\n\n         -x  Launch a browser with an explicit command. By default, chrome or\n             firefox is launched by searching your $PATH.\n\n     --host  Set up the testling url on a specific hostname. Default: localhost\n\n     --port  Set up the testling url on a specific port\n```\n\n# testling field\n\n[Read more about how the package.json \"testling\" field works.](doc/testling_field.markdown)\n\n# code coverage\n\nTo compute code coverage, just use the\n[coverify](https://npmjs.org/package/coverify)\ntransform with `-t coverify` when you run browserify.\n\n[coverify](https://npmjs.org/package/coverify) writes coverage data with\nconsole.log(), so you can pipe the output of testling through to the `coverify`\ncommand to parse the results and give human-readable output:\n\n```\n$ browserify -t coverify test.js | testling | coverify\n\nTAP version 13\n# beep boop\nok 1 should be equal\n\n1..1\n# tests 1\n# pass  1\n\n# ok\n\n# /home/substack/projects/coverify/example/test.js: line 7, column 16-28\n\n  if (err) deadCode();\n           ^^^^^^^^^^^\n\n# /home/substack/projects/coverify/example/foo.js: line 3, column 35-48\n\n  if (i++ === 10 || (false && neverFires())) {\n                              ^^^^^^^^^^^^\n\n```\n\nThe exit code of coverify is non-zero when there are unreachable expressions.\n\n# dependencies\n\nMake sure you have [PhantomJS](https://github.com/ariya/phantomjs) installed; this is the headless browser that testling will run your tests in if you are not using the `-u` option.\n\n# install\n\nFirst, install `browserify` globally so that the `testling` command can find it\nwhen there is no `browserify` in `./node_modules/.bin`:\n\n```\nnpm install -g browserify\n```\n\nthen do:\n\n```\nnpm install -g testling\n```\n\n# license\n\nMIT\n\n![attack of the testlings!](https://web.archive.org/web/20151126095557if_/http://substack.net/images/browsers/war_of_the_browsers.png)\n","publish_time":1578865239789,"_cnpm_publish_time":1578865239789,"dist-tags":{"latest":"1.7.7"}}