mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add infrastructure to build and publish as wasm32 (#3840)
Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
This commit is contained in:
@@ -69,17 +69,25 @@ describe('libvips binaries', function () {
|
||||
});
|
||||
|
||||
describe('Build time platform detection', () => {
|
||||
it('Can override platform with npm_config_platform and npm_config_libc', () => {
|
||||
it('Can override platform with npm_config_platform and npm_config_libc', function () {
|
||||
process.env.npm_config_platform = 'testplatform';
|
||||
process.env.npm_config_libc = 'testlibc';
|
||||
const [platform] = libvips.buildPlatformArch().split('-');
|
||||
const platformArch = libvips.buildPlatformArch();
|
||||
if (platformArch === 'wasm32') {
|
||||
return this.skip();
|
||||
}
|
||||
const [platform] = platformArch.split('-');
|
||||
assert.strictEqual(platform, 'testplatformtestlibc');
|
||||
delete process.env.npm_config_platform;
|
||||
delete process.env.npm_config_libc;
|
||||
});
|
||||
it('Can override arch with npm_config_arch', () => {
|
||||
it('Can override arch with npm_config_arch', function () {
|
||||
process.env.npm_config_arch = 'test';
|
||||
const [, arch] = libvips.buildPlatformArch().split('-');
|
||||
const platformArch = libvips.buildPlatformArch();
|
||||
if (platformArch === 'wasm32') {
|
||||
return this.skip();
|
||||
}
|
||||
const [, arch] = platformArch.split('-');
|
||||
assert.strictEqual(arch, 'test');
|
||||
delete process.env.npm_config_arch;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user