fix-node-modules.mjs 548 B

1234567891011121314151617181920
  1. // Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. import fs from 'fs'
  3. import path from 'path'
  4. const typesFile = path.resolve(
  5. 'node_modules/@types/testing-library__jest-dom/index.d.ts',
  6. )
  7. const encoding = 'utf8'
  8. const strings = {
  9. search: '/// <reference types="jest" />',
  10. replace:
  11. '// See https://github.com/testing-library/jest-dom/issues/427 for reference',
  12. }
  13. const result = fs
  14. .readFileSync(typesFile, encoding)
  15. .replace(strings.search, strings.replace)
  16. fs.writeFileSync(typesFile, result, encoding)