This post was written for the Testim blog. You can read the original here. Cucumber.js and BDD aren’t new kids on the block. But they’re still fairly unfamiliar for many developers. That’s unfortunate, because the two can be very powerful tools for both the business people and developers. Let’s have a short look at what BDD is, and then see how Cucumber.js can be used to your advantage. What Is BDD? If you’re unfamiliar with BDD, don’t worry. It’s not a difficult topic.
Tag: javascript
This post was written for the Testim blog. You can read the original here. Looking to test your JavaScript and/or TypeScript code? Then you could do worse than go for testing with Mocha and Chai. These two libraries are among the most popular tools that developers use to write tests for JavaScript or TypeScript code. But if you’re not familiar with them yet, let me show you how easy it is to get started. Introducing Mocha Mocha is a unit testing library that
This post was written for the Testim blog. You can read the original here. There are many libraries available to write unit tests for your JavaScript code. One popular option is QUnit. Let’s look at how you can get started with QUnit. But let’s not stop there. Measuring code coverage of your tests is a useful metric to gain insights and improve your test suite. We’ll open the tutorial with a brief overview of QUnit itself, so we’re on the
At a current client, we’re looking to move (most of) our AWS Lambda functions to NestJS. The company has built up an extensive collection of Lambda functions and it’s time to bring some structure and similarity in them. But NestJS is geared towards incoming HTTP calls. This is fine if your Lambda function is behind an API Gateway, but is it possible to use NestJS if your Lambda function should be triggered by SNS events? Uniformity? Those who know me,
Have an old(er) ASP.NET project where javascript files put all their functions and variables in the global namespace? Want to move to modern javascript (ES2015) with dynamic module loading? If you don’t know where to begin, this guide might be able to help you. I was facing the same issue in an ASP.NET project (MVC, but it should be possible for WebForms too). It’s actually quite simple. We’ll go from this: Browser loads a page Browser loads all included javascript
I have written and talked about how I’ve stopped going to user group sessions, but recently I’ve found the urge to reconnect with some sort of community again. I still find bigger conferences like Techorama or ngEurope interesting, especially if they get me out of the Microsoft-centric world I find myself in due to working for big corporations in Belgium. So I was pleasantly surprised to receive a mail from one Jan Rauter where he introduced a new community, revolving
I’m really a fan of Metalsmith, which I’ve written about before. It’s super easy to get up and running, and the syntax is simple too. Also nice, is the fact that it doesn’t choose between configuration or code. You can use either a JSON file or Node. At a certain point in time, you’re likely to need something that nobody has written a Metalsmith plugin for yet. This is probably more true now, when it’s still quite early days for
In my previous post on Metalsmith, I explained how to get up and running with Metalsmith. I used a metalsmith.json configuration file. But it is also possible to use a javascript file and let NodeJS run it. Take this metalsmith.json file for example: { “source”: “src”, “destination”: “build”, “plugins”: { “metalsmith-drafts”: true, “metalsmith-markdown”: true, “metalsmith-layouts”: { “engine”: “handlebars”, “partials”: “partials” } } } This can be mapped to the following javascript file: var Metalsmith = require(‘./node_modules/metalsmith’), drafts = require(‘./node_modules/metalsmith-drafts), markdown
Being a consultant, I am now the owner of a (humble) company. And a company should have a website, no? But this website doesn’t need to many bells and whistles, and I’m keeping my blog at www.petermorlion.com, so a static html website would do. I know about Jekyll, but it’s Ruby and I’m on Windows, and I know it’s possible, but it’s a bit of a hassle. I took a look at Brunch but it’s more of a general-purpose tool.
In one of my previous posts on Aurelia, I set up Aurelia with ASP.NET, using jspm to load my scripts, and Babel to transpile the ES2015/2016 (previously called ES6/7) to ES5. The problem is, this happens on-the-fly. This will reduce the speed of our app, as there is extra processing done when the user requests a page. Also, there is no reason to do this, as the scripts can be transpiled before deploying (i.e. when building our app in Visual