Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "fastify-plugin",
"version": "5.1.0",
"description": "Plugin helper for Fastify",
"main": "plugin.js",
"main": "index.js",
"type": "commonjs",
"types": "types/plugin.d.ts",
"types": "types/index.d.ts",
"scripts": {
"lint": "eslint",
"lint:fix": "eslint --fix",
Expand Down
2 changes: 1 addition & 1 deletion test/bundlers.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { test } = require('node:test')
const fp = require('../plugin')
const fp = require('..')

test('webpack removes require.main.filename', t => {
const filename = require.main.filename
Expand Down
2 changes: 1 addition & 1 deletion test/checkVersion.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { test } = require('node:test')
const fp = require('../plugin')
const fp = require('..')

test('checkVersion having require.main.filename', (t) => {
const info = console.info
Expand Down
2 changes: 1 addition & 1 deletion test/composite.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { test } = require('node:test')
const fp = require('../plugin')
const fp = require('..')

test('anonymous function should be named composite.test0', (t) => {
t.plan(2)
Expand Down
2 changes: 1 addition & 1 deletion test/esm/esm.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test } from 'node:test'
import fp from '../../plugin.js'
import fp from '../../index.js'

test('esm base support', (t) => {
fp((_fastify, _opts, next) => {
Expand Down
2 changes: 1 addition & 1 deletion test/mu1tip1e.composite.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const { test } = require('node:test')
const fp = require('../plugin')
const fp = require('..')

test('anonymous function should be named mu1tip1e.composite.test', (t) => {
t.plan(2)
Expand Down
6 changes: 3 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { test } = require('node:test')
const proxyquire = require('proxyquire')
const fp = require('../plugin')
const fp = require('..')
const Fastify = require('fastify')

const pkg = require('../package.json')
Expand Down Expand Up @@ -138,7 +138,7 @@ test('Should accept an option object and checks the version', (t) => {
})

test('should set anonymous function name to file it was called from with a counter', (t) => {
const fp = proxyquire('../plugin.js', { stubs: {} })
const fp = proxyquire('../index.js', { stubs: {} })

const fn = fp((_fastify, _opts, next) => {
next()
Expand All @@ -158,7 +158,7 @@ test('should set anonymous function name to file it was called from with a count
test('should set function name if Error.stackTraceLimit is set to 0', (t) => {
const stackTraceLimit = Error.stackTraceLimit = 0

const fp = proxyquire('../plugin.js', { stubs: {} })
const fp = proxyquire('../index.js', { stubs: {} })

const fn = fp((_fastify, _opts, next) => {
next()
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion types/plugin.tst.ts → types/index.tst.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'tstyche'
import fastifyPlugin from './plugin'
import fastifyPlugin from '.'
import fastify, {
FastifyPluginCallback,
FastifyPluginAsync,
Expand Down
Loading