Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@japa/expect

Package Overview
Dependencies
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@japa/expect - npm Package Compare versions

Comparing version
3.0.2
to
3.0.3
+2
-2
build/index.d.ts

@@ -0,3 +1,3 @@

import { expect as jestExpect } from 'expect';
import type { PluginFn } from '@japa/runner/types';
import { Expect } from './src/types.js';
/**

@@ -9,4 +9,4 @@ * Expect plugin for "@japa/runner"

interface TestContext {
expect: Expect;
expect: typeof jestExpect;
}
}

@@ -1,27 +0,20 @@

/*
* @japa/expect
*
* (c) Japa.dev
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { expect as jestExpect } from 'expect';
import { Test, TestContext } from '@japa/runner/core';
/**
* Expect plugin for "@japa/runner"
*/
export function expect() {
return function () {
TestContext.getter('expect', () => jestExpect, true);
Test.executed(function (_, hasError) {
if (hasError) {
return;
}
const jestErrors = jestExpect.extractExpectedAssertionsErrors();
if (jestErrors.length) {
throw jestErrors[0].error;
}
});
};
// index.ts
import { expect as jestExpect } from "expect";
import { Test, TestContext } from "@japa/runner/core";
function expect() {
return function() {
TestContext.getter("expect", () => jestExpect, true);
Test.executed(function(_, hasError) {
if (hasError) {
return;
}
const jestErrors = jestExpect.extractExpectedAssertionsErrors();
if (jestErrors.length) {
throw jestErrors[0].error;
}
});
};
}
export {
expect
};
{
"name": "@japa/expect",
"description": "Assertion package built on top of Jest expect",
"version": "3.0.2",
"version": "3.0.3",
"engines": {
"node": ">=18.16.0"
},
"main": "build/index.js",
"type": "module",
"files": [
"index.ts",
"src",
"build/src",
"build/index.d.ts",
"build/index.js",
"build/index.d.ts.map"
"build",
"!build/bin",
"!build/tests"
],
"exports": {
".": "./build/index.js",
"./types": "./build/src/types.js"
".": "./build/index.js"
},
"scripts": {
"pretest": "npm run lint && npm run typecheck",
"pretest": "npm run lint",
"test": "c8 npm run quick:test",
"quick:test": "echo \"No tests yet\"",
"lint": "eslint .",
"format": "prettier --write .",
"typecheck": "tsc --noEmit",
"clean": "del-cli build",
"compile": "npm run lint && npm run clean && tsc",
"precompile": "npm run lint && npm run clean",
"compile": "tsup-node && tsc --emitDeclarationOnly --declaration",
"build": "npm run compile",
"release": "np --message=\"chore(release): %s\"",
"version": "npm run build",
"prepublishOnly": "npm run build",
"lint": "eslint . --ext=.ts",
"typecheck": "tsc --noEmit",
"format": "prettier --write .",
"sync-labels": "github-label-sync --labels .github/labels.json japa/expect"
"release": "release-it",
"quick:test": "echo \"No tests yet\""
},
"devDependencies": {
"@adonisjs/eslint-config": "^1.3.0",
"@adonisjs/prettier-config": "^1.3.0",
"@adonisjs/tsconfig": "^1.3.0",
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@japa/runner": "^3.1.2",
"@swc/core": "^1.4.11",
"@adonisjs/eslint-config": "^2.0.0-beta.7",
"@adonisjs/prettier-config": "^1.4.0",
"@adonisjs/tsconfig": "^1.4.0",
"@japa/runner": "^4.0.0",
"@release-it/conventional-changelog": "^9.0.4",
"@swc/core": "^1.10.4",
"@types/luxon": "^3.4.2",
"@types/node": "^20.11.30",
"c8": "^9.1.0",
"del-cli": "^5.1.0",
"eslint": "^8.57.0",
"github-label-sync": "^2.3.1",
"husky": "^9.0.11",
"np": "^10.0.2",
"prettier": "^3.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.4.3"
"@types/node": "^22.10.5",
"c8": "^10.1.3",
"del-cli": "^6.0.0",
"eslint": "^9.17.0",
"prettier": "^3.4.2",
"release-it": "^17.11.0",
"tsup": "^8.3.5",
"typescript": "^5.7.2"
},
"dependencies": {
"expect": "^29.5.0"
"expect": "^29.7.0"
},
"peerDependencies": {
"@japa/runner": "^3.0.0"
"@japa/runner": "^3.0.0 || ^4.0.0"
},
"author": "virk,japa",
"license": "MIT",
"homepage": "https://github.com/japa/expect#readme",

@@ -78,21 +68,43 @@ "repository": {

],
"eslintConfig": {
"extends": "@adonisjs/eslint-config/package"
},
"prettier": "@adonisjs/prettier-config",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"author": "Harminder Virk <virk@adonisjs.com>",
"license": "MIT",
"publishConfig": {
"access": "public",
"tag": "latest"
"provenance": true
},
"np": {
"message": "chore(release): %s",
"tag": "latest",
"branch": "main",
"anyBranch": false
"tsup": {
"entry": [
"index.ts"
],
"outDir": "./build",
"clean": true,
"format": "esm",
"dts": false,
"sourcemap": false,
"target": "esnext"
},
"release-it": {
"git": {
"requireCleanWorkingDir": true,
"requireUpstream": true,
"commitMessage": "chore(release): ${version}",
"tagAnnotation": "v${version}",
"push": true,
"tagName": "v${version}"
},
"github": {
"release": true
},
"npm": {
"publish": true,
"skipChecks": true
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": {
"name": "angular"
}
}
}
},
"c8": {

@@ -106,3 +118,4 @@ "reporter": [

]
}
},
"prettier": "@adonisjs/prettier-config"
}

@@ -15,3 +15,5 @@ # @japa/expect

npm i @japa/expect
```
```sh
yarn add @japa/expect

@@ -18,0 +20,0 @@ ```

import { expect as jestExpect } from 'expect';
/**
* Jest expect type
*/
export type Expect = typeof jestExpect;
/*
* @japa/expect
*
* (c) Japa.dev
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
export {};
/*
* @japa/expect
*
* (c) Japa.dev
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { expect as jestExpect } from 'expect'
import type { PluginFn } from '@japa/runner/types'
import { Test, TestContext } from '@japa/runner/core'
import { Expect } from './src/types.js'
/**
* Expect plugin for "@japa/runner"
*/
export function expect(): PluginFn {
return function () {
TestContext.getter('expect', () => jestExpect, true)
Test.executed(function (_, hasError) {
if (hasError) {
return
}
const jestErrors = jestExpect.extractExpectedAssertionsErrors()
if (jestErrors.length) {
throw jestErrors[0].error
}
})
}
}
declare module '@japa/runner/core' {
interface TestContext {
expect: Expect
}
}
/*
* @japa/expect
*
* (c) Japa.dev
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { expect as jestExpect } from 'expect'
/**
* Jest expect type
*/
export type Expect = typeof jestExpect