webdriverio-community / wdio-html-reporter

Fork of wdio-html-format-reporter
MIT License
18 stars 27 forks source link

Is commonjs still supported #101

Closed vBitza closed 1 year ago

vBitza commented 1 year ago

Hi, does this package still support CommonJS or in order to use it the Wdio Project must by migrated to Modules?

rpii commented 1 year ago

webdriverio 8 is modules, look at the samples they provide. so yes it is

On Wed, Jul 5, 2023 at 3:12 AM vBitza @.***> wrote:

Hi, does this package still support CommonJS or in order to use it the Wdio Project must by migrated to Modules?

— Reply to this email directly, view it on GitHub https://github.com/rpii/wdio-html-reporter/issues/101, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEABIELBFSTQOHFLBS67VNTXOU4V7ANCNFSM6AAAAAAZ6XIX4Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

vBitza commented 1 year ago

Hi, yes I understand it supports module based on the given sample, my question was if the CommonJS is still supported.

Basically In their sample they are using Import instead of Require:

import {ReportGenerator, HtmlReporter} from 'wdio-html-nice-reporter';

I tried setting it up with require and it didn't work, so I thought I would ask for an official answer or maybe someone managed to set it up in some way.

rpii commented 1 year ago

I believe you should ask the webdriverio team for an official answer. In my experience require will not work with modules.

On Wed, Jul 5, 2023 at 11:07 PM vBitza @.***> wrote:

Hi, yes I understand it supports module based on the given sample, my question was if the CommonJS is still supported.

Basically In their sample they are using Import instead of Require:

import {ReportGenerator, HtmlReporter} from 'wdio-html-nice-reporter';

I tried setting it up with require and it didn't work, so I thought I would ask for an official answer or maybe someone managed to set it up in some way.

— Reply to this email directly, view it on GitHub https://github.com/rpii/wdio-html-reporter/issues/101#issuecomment-1623048072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEABIEI464MSDHKIYY32P3TXOZIWPANCNFSM6AAAAAAZ6XIX4Q . You are receiving this because you commented.Message ID: @.***>

rpii commented 1 year ago

Here are is my tsconfig file. the package type is set to module

On Thu, Jul 6, 2023 at 1:25 PM Rich Peters @.***> wrote:

I believe you should ask the webdriverio team for an official answer. In my experience require will not work with modules.

On Wed, Jul 5, 2023 at 11:07 PM vBitza @.***> wrote:

Hi, yes I understand it supports module based on the given sample, my question was if the CommonJS is still supported.

Basically In their sample they are using Import instead of Require:

import {ReportGenerator, HtmlReporter} from 'wdio-html-nice-reporter';

I tried setting it up with require and it didn't work, so I thought I would ask for an official answer or maybe someone managed to set it up in some way.

— Reply to this email directly, view it on GitHub https://github.com/rpii/wdio-html-reporter/issues/101#issuecomment-1623048072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEABIEI464MSDHKIYY32P3TXOZIWPANCNFSM6AAAAAAZ6XIX4Q . You are receiving this because you commented.Message ID: @.***>

gpaciga commented 1 year ago

See #104; WDIO v8 was written so that it would be compatible with existing CJS suites, and it would be nice if this module could follow that same pattern.

vBitza commented 1 year ago

Closing this issue as resolved.

Bottom line is as of 18.8.2023, the latest version of wdio-html-reporter 7.7.1 does not support CJS, it works with Modules only.

Follow up will be done once the project starts getting maintained by the Wdio community as per #104

Thanks all!