how to

Chemical projects scale up: how to go from laboratory to commercial / Joe M. Bonem

Online Resource




how to

How to optimize fluid bed processing technology: part of the expertise in pharmaceutical process technology series / Dilip M. Parikh

Online Resource




how to

How to test React components using Karma and webpack

I’m working on a project at Twitter that uses React and webpack. After a few conversations with @sokra last year, this is the setup I put in place for testing React components (authored using JSX and ES6) using Karma.

Dependencies

You’ll need to install various packages. It looks like a lot of dependencies, but all the non-Karma packages will be necessary for general module bundling during development.

Full set of required packages:

webpack entry file

If you use webpack-specific features in your modules (e.g., loaders, plugins) you will need to use webpack to build a test bundle. The fastest and simplest approach is to create a single, test-specific entry file.

Create a file named tests.bundle.js. Within this file, you create a webpack context to match all the files that conform to a naming pattern – in this case *.spec.js(x).

var context = require.context('.', true, /.+.spec.jsx?$/);
context.keys().forEach(context);
module.exports = context;

Next, you point Karma to this file.

Karma config

Karma is configured using a karma.conf.js file. The browsers, plugins, and frameworks are specified in the standard way.

Point Karma at the tests.bundle.js file, and run it through the relevant preprocessor plugins (see example below).

The karma-webpack plugin relies on 2 custom properties of the Karma config: webpack and webpackMiddleware. The value of the former must be a webpack config object.

module.exports = function (config) {
  config.set({
    browsers: [ 'Chrome' ],
    // karma only needs to know about the test bundle
    files: [
      'tests.bundle.js'
    ],
    frameworks: [ 'chai', 'mocha' ],
    plugins: [
      'karma-chrome-launcher',
      'karma-chai',
      'karma-mocha',
      'karma-sourcemap-loader',
      'karma-webpack',
    ],
    // run the bundle through the webpack and sourcemap plugins
    preprocessors: {
      'tests.bundle.js': [ 'webpack', 'sourcemap' ]
    },
    reporters: [ 'dots' ],
    singleRun: true,
    // webpack config object
    webpack: {
      devtool: 'inline-source-map',
      module: {
        loaders: [
          {
            exclude: /node_modules/,
            loader: 'babel-loader,
            test: /.jsx?$/
          }
        ],
      }
    },
    webpackMiddleware: {
      noInfo: true,
    }
  });
};

Rather than duplicating your webpack config, you can require it in the Karma config file and override the devtool value to get sourcemaps working.

var webpackConfig = require('./webpack.config');
webpackConfig.devtool = 'inline-source-map';

module.exports = function (config) {
  config.set({
    ...
    webpack: webpackConfig
  });
};

That’s all you need to do to configure Karma to use webpack to load your JSX, ES6 React components.




how to

Stop complainers and energy drainers [electronic resource] : how to negotiate work drama to get more done / Linda Byars Swindling

Swindling, Linda Byars, 1965-




how to

Succeeding in the project management jungle [electronic resource] : how to manage the people side of projects / Doug Russell

Russell, Doug




how to

Successful project management [electronic resource] : how to complete projects on time, on budget, and on target / Michael S. Dobson

Dobson, Michael Singer, author




how to

The talent assessment and development pocket tool kit [electronic resource] : how to get the most out of your best people / Brenda Hampel and Anne Bruce

Hampel, Brenda




how to

Talking to crazy [electronic resource] : how to deal with the irrational and impossible people in your life / Mark Goulston

Goulston, Mark




how to

The tech entrepreneur's survival guide [electronic resource] : how to bootstrap your startup, lead through tough times, and cash in for success / Bernd Schoner

Schoner, Bernd




how to

Welcome to management [electronic resource] : how to go from top performer to excellent leader / by Ryan Hawk

Hawk, Ryan, author




how to

Who are your best people? [electronic resource] : how to find, measure and manage your top talent / Robin Stuart-Kotze and Chris Dunn

Stuart-Kotze, Robin




how to

Why American elections are flawed (and how to fix them) [electronic resource] / Pippa Norris

Norris, Pippa, author




how to

Why digital transformations fail [electronic resource] : the surprising disciplines of how to take off and stay ahead / Tony Saldanha

Saldanha, Tony, author




how to

Workarounds that work [electronic resource] : how to conquer anything that stands in your way at work / Russell Bishop

Bishop, Russell, 1950-




how to

Your first 100 days [electronic resource] : how to make maximum impact in your new leadership role / Niamh O'Keeffe

O'Keeffe, Niamh




how to

How to Create Custom WordPress Editor Blocks in 2020

Peter Tasker on creating blocks right now:

It’s fairly straightforward these days to get set up with the WP CLI ‘scaffold’ command. This command will set up a WordPress theme or plugin with a ‘blocks’ folder that contains the PHP and base CSS and JavaScript required to create a custom block. The only drawback that I noticed is that the JavaScript uses the old ES5 syntax rather than modern ESNext. Modern JavaScript allows us to write more concise

Read article “How to Create Custom WordPress Editor Blocks in 2020”

The post How to Create Custom WordPress Editor Blocks in 2020 appeared first on CSS-Tricks.




how to

How to Use Block Variations in WordPress

WordPress 5.4 was released not so long ago and, along with other improvements and bug fixes, it introduced a feature called Block Variations. I had a chance to use it on one of my recent projects and am so pleasantly surprised with how smart this feature is. I actually think it hasn’t received the attention it deserves, which is why I decided to write this article.

What is a Block Variation?

Block Variations allow developers to define instances of existing Read article “How to Use Block Variations in WordPress”

The post How to Use Block Variations in WordPress appeared first on CSS-Tricks.




how to

How to Publish an Updated Version of an npm Package

What’s typically involved in an npm version release? How can you determine the release process for an existing project? Can project maintainers do anything to make it easier for new contributors?




how to

Quick Tip: How to Hide Whitespace Changes in Git Diffs

If you’ve ever had to review a PR where the only code change is adding a wrapper element, you’ll be familiar with the pain of reviewing what appears to be a massive change but is actually trivial.




how to

Studying primates : how to design, conduct and report primatological research / Joanna M. Setchell

Setchell, Joanna M., 1973- author




how to

The tech headaches of working from home and how to remedy them

From shoddy Wi-Fi to digital distractions, our tech can make remote work miserable. Brian X Chen has tips on how to overcome the problems




how to

The New Rules of Marketing and PR: How to Use Content Marketing, Podcasting, Social Media, AI, Live Video, and Newsjacking to Reach Buyers Directly, 7th Edition


 

The seventh edition of the pioneering guide to generating attention for your idea or business, packed with new and updated information

In the Digital Age, marketing tactics seem to change on a day-to-day basis. As the ways we communicate continue to evolve, keeping pace with the latest trends in social media, the newest online videos, the latest mobile apps, and all the other high-tech influences can seem an almost impossible task. How can you keep



Read More...




how to

How to make a sweat sensor for drugs

Guidelines include how to deal with pesky interfering signals when making voltammetric sensors




how to

How to make aziridines from olefins without expensive metals

Double bonds form nitrogen-containing 3-membered rings thanks to a reactive, yet fleeting, oxaziridine intermediate




how to

How to answer difficult interview questions




how to

How to make aziridines from olefins without expensive metals

Double bonds form nitrogen-containing 3-membered rings thanks to a reactive yet fleeting oxaziridine intermediate




how to

How to add a carbonyl to a molecule using carbon monoxide and light

Palladium-catalyzed reaction makes acid chlorides, amides, esters, and ketones from both alkyl and aryl halides




how to

The New Rules of Marketing and PR: How to Use Content Marketing, Podcasting, Social Media, AI, Live Video, and Newsjacking to Reach Buyers Directly, 7th Edition


 

The seventh edition of the pioneering guide to generating attention for your idea or business, packed with new and updated information

In the Digital Age, marketing tactics seem to change on a day-to-day basis. As the ways we communicate continue to evolve, keeping pace with the latest trends in social media, the newest online videos, the latest mobile apps, and all the other high-tech influences can seem an almost impossible task. How can you keep



Read More...




how to

The Quantum Mechanics Solver: How to Apply Quantum Theory to Modern Physics / by Jean-Louis Basdevant, Jean Dalibard

Online Resource




how to

Si detectors and characterization for HEP and photon science experiment: how to design detectors by TCAD simulation / Ajay Kumar Srivastava

Online Resource




how to

Covid-19: How to handle your credit card during these times

Always try to pay the full dues to avoid high interest charges




how to

Inhabiting the sacred in everyday life: how to design a place that touches your heart, stirs you to consecrate and cultivate it as home, dwell intentionally within it, slay monsters for it, and let it loose in your democracy / Randolph T. Hester, Jr. and

Rotch Library - HT167.H47 2019




how to

Great teachers: how to raise student learning in Latin America and the Caribbean / Barbara Bruns and Javier Luque [and seven others] ; cover design, Vladimir Herrera

Online Resource




how to

How to enjoy Kerala food in East Delhi

You realise you had good food days only once they’re over, but to get a tiny glimpse of what you're missing, there's always delivery




how to

The Game of Life and How to Play It: The Self-help Classic


 

The classic self-help guide, full of timeless wisdom

Florence Scovel Shinn’s The Game of Life and How to Play It first appeared in bookstores in 1925 and is now considered a classic in the self-help genre. The author’s insights into achieving meaning, happiness and success are just as relevant and effective today as they were nearly a century ago, hence its reissue as part of the exciting Capstone Classics line.



Read More...




how to

Positively Geared: How to Build a Multi-million Dollar Property Portfolio from a $40K Deposit


 
Fast-track your financial dreams with this Aussie property investment guide for the 2020s

Positively Geared offers a powerful approach for clever property investment, empowering readers to make money when they buy properties, not just when you sell them. This sustainable approach to wealth building will equip you with the knowledge, skills and insider strategies to not only build a diverse property portfolio, but also maintain a portfolio that achieves


Read More...




how to

The New Rules of Marketing and PR: How to Use Content Marketing, Podcasting, Social Media, AI, Live Video, and Newsjacking to Reach Buyers Directly, 7th Edition


 

The seventh edition of the pioneering guide to generating attention for your idea or business, packed with new and updated information

In the Digital Age, marketing tactics seem to change on a day-to-day basis. As the ways we communicate continue to evolve, keeping pace with the latest trends in social media, the newest online videos, the latest mobile apps, and all the other high-tech influences can seem an almost impossible task. How can you keep



Read More...





how to

How to deduct TDS against salary under new rules from April? CBDT clarifies

The circular also addresses the confusion that there cannot be a change in option by the employee during the year, coming as a relief for employers




how to

#ReadersSpeak: How to pout like KJo!

We asked you, dear readers, if you could do the KJo, and Preeti Sharma has proved that she certainly can!




how to

How to Enroll Participants in Research Ethically

Interview with David Wendler, PhD, author of How to Enroll Participants in Research Ethically




how to

Implementing Accountable Care Organizations: Ten Potential Mistakes and How to Learn From Them

Interview with Stephen M. Shortell, PhD, MPH, MBA, author of Implementing Accountable Care Organizations: Ten Potential Mistakes and How to Learn From Them




how to

Huge asteroid to safely pass earth on April 28, 2020, here's how to watch it

A huge asteroid is set to safely pass earth earth on April 29, 2020 and though the asteroid will not hit the earth excitement is building among both professional and amateur astronomers to catch a glimpse of this asteroid.




how to

Eta Aquariid meteor shower to peak on May 6: How to see the shooting stars

The Eta Aquarid meteors make up the debris trail of Halley’s Comet, which passes by Earth every 76 years.




how to

How to read Islamic calligraphy / Maryam D. Ekhtiar

Rotch Library - NK3636.5.E44 2018




how to

How to fix your academic writing trouble : a practical guide / Inger Mewburn, Katherine Firth and Shaun Lehmann

Mewburn, Inger, author




how to

How to do a research project : a guide for undergraduate students / Colin Robson

Robson, Colin, author




how to

How to get filthy rich in rising Asia / Mohsin Hamid

Hamid, Mohsin, 1971- author




how to

How to find a postdoc position that’s right for you

Our Letters to Young Scientists columnists share insights into the postdoc application process




how to

How to tell whether you’re the victim of a bad peer review

Our Experimental Error columnist wishes for peer reviews of peer reviewers’ reviews