{"name":"testling","description":"write tests for browser code","version":"1.7.7","repository":{"type":"git","url":"git://github.com/tape-testing/testling.git"},"browserify":"browser.js","bin":{"testling":"bin/cmd.js"},"keywords":["test","browser","headless"],"scripts":{"prebuild":"rimraf bundle","build":"mkdir -p bundle && browserify browser/prelude.js -o bundle/prelude.js","prepublishOnly":"safe-publish-latest && npm run build","prepublish":"not-in-publish || npm run prepublishOnly","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"dependencies":{"@tapjs/tap-finished":"^0.0.3","bouncy":"^3.2.2","browser-launcher":"^1.0.2","browserify":"^3.46.1","concat-stream":"^1.6.2","cross-spawn":"^5.1.0","ecstatic":"^0.4.13","ent":"^0.0.8","glob":"^3.2.11","jsonify":"^0.0.1","object-inspect":"^1.13.2","optimist":"^0.6.1","resolve":"^2.0.0-next.5","shallow-copy":"^0.0.1","shell-quote":"^1.8.1","xhr-write-stream":"^0.1.2"},"devDependencies":{"auto-changelog":"^2.5.0","encoding":"^0.1.13","in-publish":"^2.0.1","rimraf":"^3.0.2","safe-publish-latest":"^2.0.0","tape":"^5.9.0"},"engines":{"node":">=0.8"},"license":"MIT/X11","author":{"name":"Jordan Harband","email":"ljharb@gmail.com"},"funding":{"url":"https://github.com/sponsors/ljharb"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"_id":"testling@1.7.7","gitHead":"201e97397c7eb4facb62697123a014dc0c2f22b9","bugs":{"url":"https://github.com/tape-testing/testling/issues"},"homepage":"https://github.com/tape-testing/testling#readme","_nodeVersion":"22.9.0","_npmVersion":"10.8.3","dist":{"integrity":"sha512-2VeY2XwMzmtHp+fBmbufq9+o9tNMcBJ1wI7JawayNPI+tsWPgzsZ3N24vAPbGY6UyOS2+bRMhJtZq+QybWeZ2g==","shasum":"197d3c195b642ea2217e355f5ccfd50ee880b06c","tarball":"http://registry-npm.ywwl.com/testling/download/testling-1.7.7.tgz","fileCount":12,"unpackedSize":261365,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEEg8K3Nj+PJfWj3eokKPBKwGkbr0jILwBypV0DblRFdAiEAoqBfTki/aQAoNXETK0fvnIhNJFXlYvi4cky2WIvI7rs="}],"size":69942,"noattachment":false,"key":"/testling/-/testling-1.7.7.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/testling_1.7.7_1727398812897_0.06943711553280285"},"_hasShrinkwrap":false,"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":1727398813082,"_cnpm_publish_time":1727398813082,"dist-tags":{"latest":"1.7.7"}}