question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to run and test locally?

See original GitHub issue

This issue is created in response to https://github.com/LeaVerou/color.js/issues/54#issuecomment-703844158.

I’m not sure it is a bug as much as maybe a question. How can one quickly run and evaluate this project locally? Coding up a web environment is surely possible, and one could import the code and test, but when it mentioned you could install via npm, I found that an attractive option as I was looking more to debug issue #50

  1. Tried to install via the documentation’s recommendation for node, and the package isn’t found in the registry, so maybe that is outdated.

  2. Tried to install by using the git repo, seemed to work, but couldn’t figure out how to import it. Seems it is an ESM module as it complained about import? Struggled to figure out when I couldn’t load it. Googled some things and tried to load it as an ESM module, but only ran into other complaints.

Maybe all that is needed is a little documentation for the less knowledgable like me 🙂.

I’m on node.js v14.4.0.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:34 (26 by maintainers)

github_iconTop GitHub Comments

2reactions
LeaVeroucommented, Dec 10, 2020

Thanks for the nudge! Just published it: https://www.npmjs.com/package/colorjs.io

Let us know how it goes!

Btw, if you’re using it to parse CSS colors, please note that hex colors and color keywords are not yet parsed in Node (as they depend on browser APIs for parsing). We do plan to change that.

1reaction
facelessusercommented, Dec 10, 2020

Changing the above, mentioned lines fixes @kripod’s issues:

> const { default: Color } = require("colorjs.io/dist/color.cjs");
undefined
> console.log(new Color("#ff0000").set({ alpha: 0.5 }).toString());
rgb(100% 0% 0% / 0.5)
undefined
Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing a Cloud Run service locally
You can use Cloud Code or Docker installed locally to run and test locally, including running locally with access to Google Cloud services....
Read more >
Running tests locally - The Chromium Projects
Build · Set the test as the startup project and press F5 to compile it. · Or in a cmd window, run the...
Read more >
How do you set up a local testing server? - MDN Web Docs
Running a simple local HTTP server · Go to python.org · Under the Download section, click the link for Python "3. · At...
Read more >
Run tests on localhost and staging websites - BrowserStack
Test your locally hosted websites. Learn how to run your Cypress tests on your locally hosted and staging websites using BrowserStack Automate.
Read more >
Run multiple tests locally - Testim overview
Run multiple tests locally · Go to Test List > Tests · Select two or more tests in the Test Library.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found