{"_id":"karma-ava","_rev":"13-55e331143f145eb32a3834ef55a90239","name":"karma-ava","description":"Karma plugin for AVA","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"karma-ava","version":"0.0.1","description":"Karma plugin for AVA","license":"MIT","repository":{"type":"git","url":"git+https://github.com/avajs/karma-ava.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc ava","demo":"karma start"},"files":["index.js","lib"],"keywords":[],"dependencies":{"babel-core":"^6.9.1","bluebird":"^3.4.1","browserify":"^13.0.1","convert-source-map":"^1.2.0","express":"^4.14.0","figures":"^1.7.0","find-cache-dir":"^0.1.1","md5-hex":"^1.3.0","object-assign":"^4.1.0","pify":"^2.3.0","resolve-from":"^2.0.0","through2":"^2.0.1"},"devDependencies":{"ava":"github:jamestalmage/ava#karma-ava","browser-unpack":"^1.1.1","karma":"^1.1.0","karma-chrome-launcher":"^1.0.1","nyc":"^6.6.1","supertest":"^1.2.0","supertest-as-promised":"^3.1.0","xo":"^0.16.0"},"xo":{"envs":["browser","node"]},"gitHead":"75629781acda0f2325323d25a7673281c97556e0","bugs":{"url":"https://github.com/avajs/karma-ava/issues"},"homepage":"https://github.com/avajs/karma-ava#readme","_id":"karma-ava@0.0.1","_shasum":"2e5e3936a711e92e61f5fbae48b3ee0114c5588d","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.10.1","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"2e5e3936a711e92e61f5fbae48b3ee0114c5588d","tarball":"https://registry.npmjs.org/karma-ava/-/karma-ava-0.0.1.tgz","integrity":"sha512-ekR1Es5vZgJJntqwTa3wc8JmbxgfN5+7XLmzaP0IrbbbkhXsUkmDRGaR/l6ae/eU3wNFqllBqH5vZkuh73K3gQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5q93L+dJH1sMtu3aqYCtE4tlbQbJIT6tIBFnBJ9WryQIhANomZlErPygZUPLZQAzAuW4/b4ePJu4JUiMWjo7s2ziS"}]},"maintainers":[{"name":"jamestalmage","email":"james@talmage.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/karma-ava-0.0.1.tgz_1467076615864_0.4072540579363704"}}},"readme":"# karma-ava [![Build Status](https://travis-ci.org/jamestalmage/karma-ava.svg?branch=master)](https://travis-ci.org/jamestalmage/karma-ava)\n\n> Run AVA tests with karma\n\n*WARNING: Alpha level software - for evaluation use only*\n\n## Install\n\n*Note: this currently requires a custom build of AVA*\n\n```\n$ npm install --save-dev jamestalmage/ava#karma-ava karma karma-ava karma-chrome-launcher\n```\n\n\n## Usage\n\nCreate a `karma.conf.js`, like so:\n\n```js\nmodule.exports = function(config) {\n  config.set({\n    frameworks: ['ava'],\n    files: [\n      'test/*.js'\n    ],\n    browsers: ['Chrome']\n  });\n};\n```\n\nThen run `karma start`:\n\n```\n$ node_modules/.bin/karma start\n```\n\n## Notes\n\n- Be careful not to include test helpers in the `files` pattern (future improvements will automatically filter helpers out).\n\n\n## How it works\n\n1. The `ava` preprocessor (`lib/preprocessor.js`) bundles up a single test. Instead of returning the bundle result. It stores it at `node_modules/.cache/karma-ava/<UNIQUE-HASH>.js`. Karma sees a one-liner function call as the result:\n\n  ```js\n  window.__AVA__.addFile(AVA_HASH, TEST_HASH, TEST_PREFIX);\n  ```\n\n  - `AVA_HASH` is the cache key for the external bundle of AVA common to all tests. It just contains AVA and it's dependencies.\n\n  - `TEST_HASH` is the cache key for the individual test bundle.\n\n  - `TEST_PREFIX` is a string prefix to put before the test title, something like: `\"dirname > filename > \"`.\n\n2. The `ava` middleware provides two routes:\n\n  - `/karma-ava/<CACHE_KEY>.js` - returns the the bundle stored for that cache key (could be individual test bundles or the common AVA bundle).\n\n  - `/karma-ava/child/:avaHash/:testHash` - returns an `html` page that simply loads two bundles (the common bundle, and the individual test bundle). These pages will be loaded into `iframes` by the main process.\n\n3. `lib/main.js`\n\n  - This is loaded in the main window by the framework. It provides the `window.__AVA__.addFile()` method discussed above, and acts as a test runner for individual iFrames. It also communicates test results back to the Karma server in a format it understands.\n\n\n## TODO's\n\n- Create opinionated, configuration-free defaults that follow AVA's current style.\n\n- Give the user greater control over what goes in the external/common bundle.\n\n- Automatically ignore test helpers\n\n- Create a custom karma reporter that uses AVA's own loggers\n\n- Honor `ava` config params from `package.json`\n\n- Allow for custom `babel` configs\n\n- Use `watchify` for faster rebuilds and smart, dependency-based rerun behavior.\n\n\n## License\n\nMIT © [James Talmage](http://github.com/jamestalmage)\n","maintainers":[{"email":"vdemedes@gmail.com","name":"vdemedes"},{"email":"mark@novemberborn.net","name":"novemberborn"},{"email":"sindresorhus@gmail.com","name":"sindresorhus"}],"time":{"modified":"2022-06-19T07:53:52.090Z","created":"2016-06-28T01:16:58.288Z","0.0.1":"2016-06-28T01:16:58.288Z"},"homepage":"https://github.com/avajs/karma-ava#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/avajs/karma-ava.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"bugs":{"url":"https://github.com/avajs/karma-ava/issues"},"license":"MIT","readmeFilename":"readme.md"}