Samsung / TAU-Design-Editor

TAU Design Editor can create web application by drag&drop the TAU based widget
MIT License
28 stars 18 forks source link

Fix Travis config according to new Custom Element API #477

Open korneliakobiela opened 4 years ago

korneliakobiela commented 4 years ago

Technical

WATT/VSCode

Description

Our test environment isn't prepared for Custom Elements v1.

Steps to reproduce

  1. Run: 'npm run test' in DE

Expected behaviour

Test pass

Actual behaviour

Test fail

Testing WATT...
/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/yargs/yargs.js:1163
      else throw err
           ^

ReferenceError: customElements is not defined
    at Object.<anonymous> (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/design-editor/src/panel/property/component/component-element.js:605:1)
    at Module._compile (internal/modules/cjs/loader.js:799:30)
    at Module._compile (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Object.newLoader [as .js] (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)
    at Module.require (internal/modules/cjs/loader.js:705:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/test/panel/property/component/component-element.test.js:5:1)
    at Module._compile (internal/modules/cjs/loader.js:799:30)
    at Module._compile (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Object.newLoader [as .js] (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)
    at Module.require (internal/modules/cjs/loader.js:705:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at /home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/mocha/lib/mocha.js:334:36
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/mocha/lib/mocha.js:331:14)
    at Mocha.run (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/mocha/lib/mocha.js:809:10)
    at Object.exports.singleRun (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/mocha/lib/cli/run-helpers.js:108:16)
    at exports.runMocha (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/mocha/lib/cli/run-helpers.js:142:13)
    at Object.exports.handler.argv [as handler] (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/mocha/lib/cli/run.js:292:3)
    at Object.runCommand (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/yargs/lib/command.js:242:26)
    at Object.parseArgs [as _parseArgs] (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/yargs/yargs.js:1104:24)
    at Object.parse (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/yargs/yargs.js:566:25)
    at Object.exports.main (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/mocha/lib/cli/cli.js:68:6)
    at Object.<anonymous> (/home/k.kobiela/Workspace/WATT/libs/tau-wysiwig/node_modules/mocha/bin/mocha:164:29)
    at Module._compile (internal/modules/cjs/loader.js:799:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:862:12)
    at internal/main/run_main_module.js:21:11
korneliakobiela commented 4 years ago

I've tried to install new jsdom package. It wasn't worked but after some research, I found some helper package. https://www.npmjs.com/package/happy-dom

It should work I think I will do it tomorrow.

korneliakobiela commented 4 years ago

The issue is more complicated. We need to implement our test system on Karma. There isn't another software to Unit Test Web Components. So it looks like one week of work to configure all environment. For this reason, I'll switch to make DE work not only in DEMO mode instead of it.