Socket
Socket
Sign inDemoInstall

guestline-scripts

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

guestline-scripts

This package includes a set of scripts that makes configuring a project easier. It uses the eslint-config-guestline. It includes built in test runner.


Version published
Weekly downloads
9
decreased by-59.09%
Maintainers
1
Weekly downloads
 
Created
Source

guestline-scripts

This package includes a set of scripts that makes configuring a project easier. It uses the eslint-config-guestline. It includes built in test runner.

ESLint

If you want to see the linting in your IDE, create a file named .eslintrc with following contents in the root folder of your project:

{
  "extends": "guestline"
}

That's it!

However, if you are using Guestline Scripts, any additional rules will only be displayed in the IDE, but not in the browser or the terminal.

Tests using Jest

We are running tests using Jest. All documentation can be found here.

To run tests, add a new script in your package.json:

{
  "scripts": {
    "test": "guestline-scripts test --env=jsdom"
  }
}

Remove --env=jsdom if you do not run tests that need a document - e.g. node tests.

Watch mode

By default running tests runs the watcher with interactive CLI. However, you can force it to run tests once and finish the process by setting an environment variable called CI.

Popular CI servers already set the environment variable CI by default but you can do this yourself too:

Windows (cmd.exe)
set CI=true&&npm test

(Note: the lack of whitespace is intentional.)

Windows (Powershell)
($env:CI = $true) -and (npm test)
Linux, macOS (Bash)
CI=true npm test

Initializing Test Environment

If your app uses a browser API that you need to mock in your tests or if you just need a global setup before running your tests, add a src/setupTests.js to your project. It will be automatically executed before running your tests.

For example:

const localStorageMock = {
  getItem: jest.fn(),
  setItem: jest.fn(),
  clear: jest.fn()
};
global.localStorage = localStorageMock;

FAQs

Package last updated on 01 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc