Home Run postcss process multiple times with different settings
 I am trying to write a utility function for my tests for postcss plugins. I want to compare processed results with expected ones via jest. My issue is that the postcss process returns the same result for different files. let fs = require('fs'); let postcss = require('postcss'); let plugin = require('./'); let run = (testFile, options = {}, plugins = []) => { return new Promise((resolve, reject) => { let inputFile = ./tests/\${testFile}; let expectFile = inputFile.replace('.css', '.expected.css'); let input = fs.readFileSync(inputFile).toString(); let expect = fs.readFileSync(expectFile).toString(); plugins.unshift(plugin); postcss(plugins) .process(input, Object.assign({ from: inputFile, to: expectFile }, options)) .then(result => { resolve(expect(result.css.trim()).toEqual(expect.trim())); }) .catch(error => reject(error)); }); }; it('stacks css rules', () => run('stacking.css')); it('import files', () => run('import.css'));  I essentially want to be able to check a processed stacking.css to a stacking.expected.css. And then the same thing with import.css and import.expected.css. But although the input files are different, postcss return the same result (always the first to be processed) both times. Is there a way to do this? I've tried without a promise, I've tried expect().resolves.toEqual() inside the function passed into it also tried postcss.process().css