Skip to content

Micro front ends using web-components in react based projects.

License

Notifications You must be signed in to change notification settings

sargurgn/webcomponents-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webcomponents-demo

This project uses web-react-components libary to convert react project to web-component.

Unit tests are run using Jest and are written using react testing library and enzyme.

Integration tests are written and run using cypress automation framework.

Build Web-Components

sh build.sh

This creates js files in dist directory for each webcomponent we are exporting.

Running Unit tests for webcomponents

cd testable-webcomponent
npm test

We can find the test results under test-result directory and coverage report under coverage directory Test Result

Coverage Report

Start Web Server

brew update
brew install nginx

Edit vi /usr/local/etc/nginx/nginx.conf to locate dist directory of webcomponents

location ~* \.(js|jpg|png|css)$ {
    root <path/to/cloned_location>/micro-front-ends/testable-webcomponent/dist;
}

Run Host App

cd react-host-app
npm install
npm start

Run integration tests (Testing web-component from host project)

npm run it-test

Integration Test Result

About

Micro front ends using web-components in react based projects.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published