
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
green-light
Advanced tools
There are a lot of ways you can test your project. You can go with unit-testing, integration-testing, end-to-end-testing, or by manually clicking around your site to see everything still works.
My personal favorite is functional testing. Write tests for each functionality of your project, simulate different circumstances which this specific part can run in and make sure everything is still O.K. An example would be:
import { api, browser, expect } from 'green-light';
describe('article title', () => {
describe('when it has a title', () => {
it('renders the title', (done) => {
api
.respondTo('/article/42.json')
.andReplace('/title', 'Some title');
browser
.go('/article/42')
.then((window) => {
expect(window.$('h1').text()).to.equal('Some title');
})
.then(done, done);
});
});
describe('when it has no title', () => {
it('renders no title', (done) => {
api
.respondTo('/article/42.json')
.andReplace('/title', null);
browser
.go('/article/42')
.then((window) => {
expect(window.$('h1').length).to.equal(0);
})
.then(done, done);
});
});
})
GreenLight bundles all the tools you'll need to do exactly this. It can be configured and runned with Node.
Follow the steps of the getting started guide, check out an example of a setup over here, or take a look at the documentation for each part of GreenLight for more details:
A mocked version of your API, to control what data is returned for certain URL's and usecases. Based on mocked-api.
The project you'd like to test, connected to the mocked API.
A virtual browser that visits the page that you're testing. Based on jsdom.
The actual code you'll be writing to test your project. Based on mocha and chai.
FAQs
An opinionated (but complete) set of tools for functional testing
We found that green-light demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.