Tests: run in parallel again

This commit is contained in:
Lovell Fuller 2021-03-17 23:25:34 +00:00
parent 55356c78a8
commit bdb1986e08
2 changed files with 16 additions and 15 deletions

View File

@ -80,7 +80,7 @@
"install": "(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)", "install": "(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)",
"clean": "rm -rf node_modules/ build/ vendor/ .nyc_output/ coverage/ test/fixtures/output.*", "clean": "rm -rf node_modules/ build/ vendor/ .nyc_output/ coverage/ test/fixtures/output.*",
"test": "semistandard && cpplint && npm run test-unit && npm run test-licensing", "test": "semistandard && cpplint && npm run test-unit && npm run test-licensing",
"test-unit": "nyc --reporter=lcov --branches=99 mocha --slow=1000 --timeout=60000 ./test/unit/*.js", "test-unit": "nyc --reporter=lcov --branches=99 mocha --parallel --slow=1000 --timeout=60000 ./test/unit/*.js",
"test-licensing": "license-checker --production --summary --onlyAllow=\"Apache-2.0;BSD;ISC;MIT\"", "test-licensing": "license-checker --production --summary --onlyAllow=\"Apache-2.0;BSD;ISC;MIT\"",
"test-coverage": "./test/coverage/report.sh", "test-coverage": "./test/coverage/report.sh",
"test-leak": "./test/leak/leak.sh", "test-leak": "./test/leak/leak.sh",

View File

@ -5,22 +5,23 @@ const sharp = require('../../');
const fixtures = require('../fixtures'); const fixtures = require('../fixtures');
describe('toFormat', () => { describe('toFormat', () => {
it('accepts upper case characters as format parameter (string)', function (done) { it('accepts upper case characters as format parameter (string)', async () => {
sharp(fixtures.inputJpg) const data = await sharp(fixtures.inputJpg)
.resize(8, 8)
.toFormat('PNG') .toFormat('PNG')
.toBuffer(function (err, data, info) { .toBuffer();
if (err) throw err;
assert.strictEqual('png', info.format); const { format } = await sharp(data).metadata();
done(); assert.strictEqual(format, 'png');
}); });
});
it('accepts upper case characters as format parameter (object)', function (done) { it('accepts upper case characters as format parameter (object)', async () => {
sharp(fixtures.inputJpg) const data = await sharp(fixtures.inputJpg)
.resize(8, 8)
.toFormat({ id: 'PNG' }) .toFormat({ id: 'PNG' })
.toBuffer(function (err, data, info) { .toBuffer();
if (err) throw err;
assert.strictEqual('png', info.format); const { format } = await sharp(data).metadata();
done(); assert.strictEqual(format, 'png');
});
}); });
}); });