Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

civet-jest

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

civet-jest

Test Civet files with Jest

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

civet-jest

civet-jest is a Jest transformer for automatically transpiling Civet code into JavaScript when testing via Jest.

It does not yet support chaining with babel-jest, so JSX is not supported.

Usage

Installation

  1. Install Civet if you haven't already: npm install -D @danielx/civet
  2. Install this plugin: npm install -D civet-jest

Configuration

Edit your jest.config.* file to define the transform and allow the .civet file extension. Here is an complete example jest.config.mjs:

import {defaults} from 'jest-config'

export default {
  extensionsToTreatAsEsm: [ '.civet' ],
  moduleFileExtensions: [ ...defaults.moduleFileExtensions, 'civet' ],
  testMatch: [ '<rootDir>/test/**/*.civet' ],
  transform: {
    '\\.civet': 'civet-jest',
  },
  verbose: true,
}

This directory has a similar jest.config.mjs that enables local testing via yarn test.

package.json script

In CommonJS mode, you should be able to just use:

{
  "scripts": {
    "test": "jest"
  }
}

In ESM mode, you need something like this:

{
  "scripts": {
    "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest"
  }
}

This directory has a similar package.json that enables local testing via yarn test.

Keywords

FAQs

Package last updated on 08 Jul 2024

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