Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Node.js 10 #113

Merged
merged 1 commit into from
May 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js
node_js:
- '14'
- '12'
- '10'
- '8'
before_install:
- 'sudo chown $USER /usr/local'
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"optipng": "cli.js"
},
"engines": {
"node": ">=8"
"node": ">=10"
},
"scripts": {
"postinstall": "node lib/install.js",
Expand All @@ -35,11 +35,11 @@
"logalot": "^2.0.0"
},
"devDependencies": {
"ava": "^1.4.1",
"ava": "^3.8.0",
"bin-check": "^4.0.1",
"compare-size": "^3.0.0",
"execa": "^1.0.0",
"tempy": "^0.3.0",
"xo": "^0.24.0"
"execa": "^4.0.0",
"tempy": "^0.5.0",
"xo": "^0.30.0"
}
}
10 changes: 5 additions & 5 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ test('rebuild the optipng binaries', async t => {
return;
}

const tmp = tempy.directory();
const temporary = tempy.directory();

await binBuild.file(path.resolve(__dirname, '../vendor/source/optipng.tar.gz'), [
`./configure --with-system-zlib --prefix="${tmp}" --bindir="${tmp}"`,
`./configure --with-system-zlib --prefix="${temporary}" --bindir="${temporary}"`,
'make install'
]);

t.true(fs.existsSync(path.join(tmp, 'optipng')));
t.true(fs.existsSync(path.join(temporary, 'optipng')));
});

test('return path to binary and verify that it is working', async t => {
t.true(await binCheck(optipng, ['--version']));
});

test('minify a PNG', async t => {
const tmp = tempy.directory();
const temporary = tempy.directory();
const sourcePath = path.join(__dirname, 'fixtures/test.png');
const destinationPath = path.join(tmp, 'test.png');
const destinationPath = path.join(temporary, 'test.png');
const arguments_ = [
'-strip',
'all',
Expand Down