open-index/open-npm huggingface dataset:
npm package: @jcoup/grunt-npm
Description: A set of helpers for dealing with NPM from Grunt.
Author: Vojta Jína
Latest version: 0.0.3

# grunt-npm

**A set of Grunt tasks for dealing with NPM.

## Installation

Install npm package, next to your project's `Gruntfile.js` file:

    npm install grunt-npm --save-dev

Add this line to your project's `Gruntfile.js`:

    grunt.loadNpmTasks('grunt-npm');


## Tasks

### grunt npm-show (also aliased as show)
Show all the files that would be published to NPM. This is useful if you wanna make sure you are not publishing files you don't want to...

### grunt npm-publish (also aliased as publish)

#### Configuration
```js
'npm-publish': {
  options: {
    // list of tasks that are required before publishing
    requires: ['build'],
    // if the workspace is dirty, abort publishing (to avoid publishing local changes)
    abortIfDirty: true,
    // can also be a function that returns NPM tag (eg. to determine canary/latest tag based on the version)
    tag: 'canary'
  }
}
```

### grunt npm-contributors (also aliased as contributors)
Update contributors in `package.json` - all developers who commited to the repository, sorted by number of commits. A `.mailmap` file can be used to map multiple emails to a single person.

#### Configuration
```js
'npm-contributors': {
  options: {
    file: 'package.json',
    commit: true,
    commitMessage: 'Update contributors'
  }
}
```
npm package: @jcoup/karma-commonjs
Description: A Karma plugin. Test CommonJS modules.
Author: Vojta Jina
Latest version: 1.0.3

[![Build Status](https://travis-ci.org/jamcoupe/karma-commonjs.svg?branch=master)](https://travis-ci.org/jamcoupe/karma-commonjs)

# @jcoup/karma-commonjs

> A Karma plugin that allows testing [CommonJS] modules in the browser.

## Browserify

If you're using Browserify to compile your projects, you should consider [karma-browserify](https://github.com/Nikku/karma-browserify) which runs Browserify directly. The cost is slightly slower builds (but not too bad, thanks to an incremental loading algorithm) and somewhat messier stack traces. The benefit is support for the full Browserify API and automatic discovery of 'require'd files.

#### karma-commonjs
1. Provides a lightweight commonjs wrapper around your code
2. Supports Node's `require` algorithm
3. Only reloads files that change
4. Provides stack traces that point to your original files
5. Requires you to specify files in the Karma config file

#### karma-browserify
1. Creates a temporary bundle using Browserify
2. Supports the full Browserify API, including transforms, plugins, and shims for Node globals
3. Uses [watchify](https://github.com/substack/watchify) to perform incremental rebuilds
4. Can use source maps to provide useful stack traces
5. Automatically includes required files

## Installation

The easiest way is to keep `@jcoup/karma-commonjs` as a devDependency:

`npm install @jcoup/karma-commonjs --save-dev`

which should result in the following entry in your `package.json`:

```json
{
  "devDependencies": {
    "@jcoup/karma-commonjs": "X.X.X"
  }
}
```

## Configuration
```js
// karma.conf.js
module.exports = function(config) {
  config.set({
    frameworks: ['jasmine', 'commonjs'],
    files: [
      // your tests, sources, ...
    ],

    preprocessors: {
      '**/*.js': ['commonjs']
    }
  });
};
```
Additionally you can specify a root folder (relative to project's directory) which is used to look for required modules:
```
commonjsPreprocessor: {
  modulesRoot: 'some_folder'  
}
```
When not specified the root folder defaults to the `karma.basePath/node_modules` configuration option.

#### Externals

When external dependencies have prebundled sources.
You can specify what file should be included from the root folder

```js
// karma.conf.js
module.exports = function(config) {
  config.set({
    // ...
    commonjsPreprocessor: {
      modulesRoot: 'components',
      externals: {
        'angular': 'angular/angular.min.js'
      }
    },
    // ...
  });
};
```

This effectively translates any `require('angular')` statements into `require('./components/angular/angular.min.js')`.

----

For an example project, check out Karma's [client tests](https://github.com/karma-runner/karma/tree/master/test/client).

----

For more information on Karma see the [homepage].


[homepage]: http://karma-runner.github.com
[CommonJS]: http://www.commonjs.org/
[Browserify]: https://github.com/substack/node-browserify
npm package: @jcoup/web-test-runner-jasmine
Description: Plugin for Jasmine and Web Test Runner
Author: Jamie Couperwhite
Latest version: 2.2.0

# web-test-runner-jasmine

[![npm version](https://badge.fury.io/js/@jcoup%2Fweb-test-runner-jasmine.svg)](https://badge.fury.io/js/@jcoup%2Fweb-test-runner-jasmine) ![CI Build](https://github.com/jamcoupe/web-test-runner-jasmine/actions/workflows/build.yml/badge.svg)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=jamcoupe_web-test-runner-jasmine&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=jamcoupe_web-test-runner-jasmine)

A [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/) plugin for running Jasmine.

## Setup

Import `jasmineTestRunnerConfig` and add to your `web-test-runner.config.mjs`.
If using TypeScript you can add `esbuildPlugin`.

```javascript
import { playwrightLauncher } from '@web/test-runner-playwright';
import { esbuildPlugin } from '@web/dev-server-esbuild';
import { jasmineTestRunnerConfig } from 'web-test-runner-jasmine';

export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
  ...jasmineTestRunnerConfig(),
  testFramework: {
    config: {
      defaultTimeoutInterval: 5000
    },
  },
  nodeResolve: true,
  files: ['./src/*.spec.js'],
  browsers: [playwrightLauncher({ product: 'chromium' })],
  plugins: [esbuildPlugin({ target: 'auto', sourceMap: true })]
});
```

Once added you can use Jasmine within your tests.

```javascript
describe('a test suite', () => {
  let element: HTMLElement;

  beforeEach(() => {
    element = document.createElement('p');
    element.innerHTML = 'hello there';
  });

  afterEach(() => {
    element.remove();
  });

  it('should create element', () => {
    expect(element.innerHTML).toBe('hello there');
  });
});
```

To run your tests run `web-test-runner` in the terminal.

```bash
web-test-runner
```

## TypeScript

If you use TypeScript you will need to add some additional configuiration. Update your
config to read `.ts` extentions and add the `ts: true` flag to the `esBuildPlugin`.

```javascript
import { playwrightLauncher } from '@web/test-runner-playwright';
import { esbuildPlugin } from '@web/dev-server-esbuild';
import { jasmineTestRunnerConfig } from 'web-test-runner-jasmine';

export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
  ...
  files: ['./src/*.spec.ts'],
  plugins: [esbuildPlugin({ ts: true, json: true, target: 'auto', sourceMap: true })]
  ...
});
```

Ensure you have the `@types/jasmine` package installed and add `jasmine` to the `types`
in your `tsconfig.json`.

```json
{
  "compilerOptions": {
    ...
    "types": ["jasmine"],
    ...
  }
}
```

Learn more about [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/).
npm package: @jcoup/wip
Description: Plugin for Jasmine and Web Test Runner
Author: Jamie Couperwhite
Latest version: 0.0.6

# web-test-runner-jasmine

[![npm version](https://badge.fury.io/js/web-test-runner-jasmine.svg)](https://badge.fury.io/js/web-test-runner-jasmine) ![CI Build](https://github.com/coryrylan/web-test-runner-jasmine/actions/workflows/build.yml/badge.svg)

A [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/) plugin for running Jasmine.

## Setup

Import `jasmineTestRunnerConfig` and add too your `web-test-runner.config.mjs`.
If using TypeScript you can add `esbuildPlugin`.

```javascript
import { playwrightLauncher } from '@web/test-runner-playwright';
import { esbuildPlugin } from '@web/dev-server-esbuild';
import { jasmineTestRunnerConfig } from 'web-test-runner-jasmine';

export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
  ...jasmineTestRunnerConfig(),
  testFramework: {
    config: {
      defaultTimeoutInterval: 5000
    },
  },
  nodeResolve: true,
  files: ['./src/*.spec.js'],
  browsers: [playwrightLauncher({ product: 'chromium' })],
  plugins: [esbuildPlugin({ target: 'auto', sourceMap: true })]
});
```

Once added you can use Jasmine within your tests.

```javascript
describe('a test suite', () => {
  let element: HTMLElement;

  beforeEach(() => {
    element = document.createElement('p');
    element.innerHTML = 'hello there';
  });

  afterEach(() => {
    element.remove();
  });

  it('should create element', () => {
    expect(element.innerHTML).toBe('hello there');
  });
});
```

To run your tests run `web-test-runner` in the terminal.

```bash
web-test-runner
```

## TypeScript

If you use TypeScript you will need to add some additional configuiration. Update your
config to read `.ts` extentions and add the `ts: true` flag to the `esBuildPlugin`.

```javascript
import { playwrightLauncher } from '@web/test-runner-playwright';
import { esbuildPlugin } from '@web/dev-server-esbuild';
import { jasmineTestRunnerConfig } from 'web-test-runner-jasmine';

export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
  ...
  files: ['./src/*.spec.ts'],
  plugins: [esbuildPlugin({ ts: true, json: true, target: 'auto', sourceMap: true })]
  ...
});
```

Ensure you have the `@types/jasmine` package installed and add `jasmine` to the `types`
in your `tsconfig.json`.

```json
{
  "compilerOptions": {
    ...
    "types": ["jasmine"],
    ...
  }
}
```

Learn more about [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/).