Files
zeekayandHanzo Dev 65d285cc8e Ask npm for the icon package by the name npm has
compass-icons is published by Mattermost and consumed from the registry; this
tree contains no source for it and webapp/platform has no such workspace. Under
our scope npm has nothing to fetch:

  404 Not Found - GET https://registry.npmjs.org/@hanzoteam/compass-icons/-/compass-icons-0.1.61.tgz

The lockfile is the proof of what it is. Its integrity for the renamed entry is
sha512-Xq7QHyxq7NPljgqlzwRp6tWGe5s…, byte for byte the integrity npm publishes
for @mattermost/[email protected] — one tarball, filed under a name nobody
serves. The install then succeeds on any machine whose npm cache already holds
that tarball, because a cache hit by integrity never asks the registry, and
fails on every clean one. That is the whole distance between a developer's box
and a build node: `npm ci --cache <fresh dir>` fails on master and passes here.

Same rule the scope change already applied to calls-common and desktop-api:
a package we merely consume keeps the name its publisher gave it.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-08 13:22:37 -07:00

60 lines
2.3 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
/** @type {import('jest').Config} */
const config = {
testPathIgnorePatterns: ['/node_modules/'],
clearMocks: true,
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
],
coveragePathIgnorePatterns: [
'/node_modules/',
'@hanzoteam/redux/src/selectors/create_selector',
],
coverageReporters: ['json', 'lcov', 'text-summary'],
fakeTimers: {
doNotFake: ['performance'],
},
moduleNameMapper: {
'^@hanzoteam/(components)$': '<rootDir>/../platform/$1/src',
'^@hanzoteam/(client)$': '<rootDir>/../platform/$1/src',
'^@hanzoteam/(types)/(.*)$': '<rootDir>/../platform/$1/src/$2',
'^@hanzoteam/shared/(.*)$': '<rootDir>/../platform/shared/src/$1',
'^@hanzoteam/redux/test/(.*)$':
'<rootDir>/src/packages/@hanzoteam/redux/test/$1',
'^@hanzoteam/redux/(.*)$': '<rootDir>/src/packages/@hanzoteam/redux/src/$1',
'^pdfjs-dist/.*': '<rootDir>/src/tests/pdfjs_mock.ts',
'^.+\\.(jpg|jpeg|png|apng|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/src/tests/image_url_mock.json',
'^.+\\.(css|less|scss)$': 'identity-obj-proxy',
'^.*i18n.*\\.(json)$': '<rootDir>/src/tests/i18n_mock.json',
},
moduleDirectories: ['src', 'node_modules'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
transformIgnorePatterns: [
'node_modules/(?!react-native|react-router|pdfjs-dist|p-queue|p-timeout|@mattermost/compass-icons|cidr-regex|ip-regex|serialize-error|@tiptap|marked|lowlight|devlop|fault|hast-util-to-text|@types/hast|unist-util-find-after)',
],
transform: {
'^.+\\.(js|jsx|ts|tsx|mjs)$': 'babel-jest',
},
setupFiles: ['jest-canvas-mock'],
setupFilesAfterEnv: ['<rootDir>/src/tests/setup_jest.ts'],
testEnvironment: 'jsdom',
testTimeout: 60000,
testEnvironmentOptions: {
url: 'http://localhost:8065',
},
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
snapshotFormat: {
escapeString: true,
printBasicPrototype: true,
},
};
module.exports = config;