profile
viewpoint

Ask questionsNot possible to pass a value to `level` that is valid in TypeScript

The problem

It's not possible to pass a value to level that is valid in TypeScript, since LEVELS enum is not exported.

image

Details

Possible ideas to fix this problem:

  • Expose the constants
  • Use this pattern https://github.com/microsoft/TypeScript/issues/17690#issuecomment-361215664

Code To Reproduce Issue

import ReportPortalReporter from 'wdio-reportportal-reporter';
ReportPortalReporter.sendLogToTest('foobar', 'INFO');
BorisOsipov/wdio-reportportal-reporter

Answer questions caiogondim

I don't think it is good to expose all constants because there are a lot of internal things - so we need to extact logs level somehow.

I agree with that. But in the case for LEVELS it's external, so maybe it makes sense to export it. I will push a PR.

useful!

Related questions

I have been using the latest version of reporter and service but I'm getting an error when I run my test suit: hot 1
Github User Rank List