Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,192
  • Linux
  • Apple
preinstall.test.ts2.56 kB
import { jestConsoleContext, jestContext } from '@prisma/get-platform' import { printMessageAndExitIfUnsupportedNodeVersion } from '../../scripts/preinstall' const ctx = jestContext.new().add(jestConsoleContext()).assemble() it('should exit 1 and print a message when Node.js minor version is lower than minimum - 18.0', () => { const mockExit = jest.spyOn(process, 'exit').mockImplementation() printMessageAndExitIfUnsupportedNodeVersion('18.0.0') expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(` "┌──────────────────────────────────────────────┐ │ Prisma only supports Node.js >= 18.18. │ │ Please upgrade your Node.js version. │ └──────────────────────────────────────────────┘" `) expect(mockExit).toHaveBeenCalledWith(1) mockExit.mockRestore() }) it('should exit 1 and print a message when Node.js major version is lower than minimum - 16.18', () => { const mockExit = jest.spyOn(process, 'exit').mockImplementation() printMessageAndExitIfUnsupportedNodeVersion('16.18.0') expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(` "┌──────────────────────────────────────────────┐ │ Prisma only supports Node.js >= 18.18. │ │ Please upgrade your Node.js version. │ └──────────────────────────────────────────────┘" `) expect(mockExit).toHaveBeenCalledWith(1) mockExit.mockRestore() }) it('should do nothing when Node.js version is supported - 18.18', () => { printMessageAndExitIfUnsupportedNodeVersion('18.18.0') expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(`""`) }) it('should do nothing when Node.js version is supported - current', () => { printMessageAndExitIfUnsupportedNodeVersion(process.versions.node as `${number}.${number}.${number}`) expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(`""`) }) it('should do nothing when Node.js version is supported - 20.0', () => { printMessageAndExitIfUnsupportedNodeVersion('20.0.0') expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(`""`) })

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/prisma/prisma'

If you have feedback or need assistance with the MCP directory API, please join our Discord server