Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Karma, code coverage, cross-browser testing #47

Merged
merged 12 commits into from
Mar 15, 2020

Conversation

bencmbrook
Copy link
Member

@bencmbrook bencmbrook commented Mar 2, 2020

  • Upgrades conflux to use Karma for testing
  • Webpacks examples and testing to enable more accurate crossbrowser testing (post Babel)
  • Migrates cross-browser testing to BrowserStack
  • Enables code coverage
  • Puts sourcecode under src
  • Adds webstreams polyfill for TransformStreams in Firefox etc.

@codecov
Copy link

codecov bot commented Mar 15, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@fc39ca9). Click here to learn what that means.
The diff coverage is 30.55%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #47   +/-   ##
=========================================
  Coverage          ?   17.08%           
=========================================
  Files             ?        6           
  Lines             ?      357           
  Branches          ?        0           
=========================================
  Hits              ?       61           
  Misses            ?      296           
  Partials          ?        0
Impacted Files Coverage Δ
src/crc.js 59.09% <0%> (ø)
src/index.test.js 100% <100%> (ø)
src/read.test.js 100% <100%> (ø)
src/write.test.js 100% <100%> (ø)
src/write.js 12.72% <17.64%> (ø)
src/read.js 10.32% <19.04%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc39ca9...7764b4e. Read the comment docs.

@bencmbrook bencmbrook changed the title WIP Karma testing Karma, coverage, cross-browser testing Mar 15, 2020
@bencmbrook bencmbrook changed the title Karma, coverage, cross-browser testing Karma, cod ecoverage, cross-browser testing Mar 15, 2020
@bencmbrook bencmbrook changed the title Karma, cod ecoverage, cross-browser testing Karma, code coverage, cross-browser testing Mar 15, 2020
@bencmbrook bencmbrook merged commit 276638f into master Mar 15, 2020
@delete-merged-branch delete-merged-branch bot deleted the bencmbrook/package-and-karma branch March 15, 2020 23:02
@jimmywarting
Copy link
Contributor

Hmm, you are now basically forcing the transform stream to be a polyfilled version.
and you also made this incompatible of just importing this grate zip library from just importing it in the browser.

import('https://cdn.jsdelivr.net/npm/@transcend-io/conflux@2.0.2/src/write.js')
// Uncaught (in promise) TypeError: Failed to resolve module specifier "web-streams-polyfill/ponyfill". Relative references must start with either "/", "./", or "../".

not happy with this changed, just tried to help @ibudisteanu a bit with his #64
It was not until i notice this change that i know exactly @ibudisteanu resolves from... @ibudisteanu is using native streams in his code

@bencmbrook
Copy link
Member Author

bencmbrook commented Aug 1, 2020

Is this the same as #52?

Regarding enabling <script> imports, it seems like rollup or another bundled distribution is the right way forward.

@jimmywarting
Copy link
Contributor

Is this the same as #52?

Hmm, yes

Regarding enabling <script> imports, it seems like rollup or another bundled distribution is the right way forward.

I like buildless tools... we only got one problem to make browser import possible and that is to get rid of web-streams-polyfill npm module
It just have to be available to us in some other form... StreamSaver allowed this by setting WritableStream.WritableStream = x without really forcing a dependency on web-streams-polyfill so you can bring your own version to the table

wish we could do something similar to streamsaver. Maybe we can do:

const TransformStream = globalThis.TransformStream || globalThis.WebStreamsPolyfill?.TransformStream

then npm folks can do the following if they want:

const polyfill = require('web-streams-polyfill')
globalThis.WebStreamsPolyfill = polyfill
const ZipWriter = require('conflux/write.js')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants