Skip to content
This repository was archived by the owner on Jan 31, 2023. It is now read-only.
This repository was archived by the owner on Jan 31, 2023. It is now read-only.

hastsifyPlugin assume the plugin is passed as a string #60

Open
@ben8p

Description

@ben8p
  • Operating System: Ubuntu 18.04
  • Cypress Version: 6.1.0
  • Browser Version: Chrome 87.0.4280.88

Is this a Feature or Bug?

This is a bug

Current behavior:

When checking for tsify plugin, the code is assume to have a string in plugin:
const hastsifyPlugin = browserifyOptions.plugin.includes('tsify')

Desired behavior:

plugin can also be an array, for instance:
browserifyOptions.plugin.unshift([resolve.sync('tsify'), { project: './cypress/tsconfig.json' }]);

The code should take that into account, with something like:
const hastsifyPlugin = browserifyOptions.plugin.some((entry) => (typeof entry === 'string' && entry.includes('tsify')) || (entry && entry.length && entry[0].includes('tsify')))

How to reproduce:

  • Use browserifyOptions.plugin.unshift([resolve.sync('tsify'), { project: './cypress/tsconfig.json' }]); in the config
  • specify the typescript property

no error raised

Additional Info (images, stack traces, etc)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions