diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e1874abf5..023d0a5ab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,19 +44,19 @@ You can use the coverage report to help with missed tests, but you must be aware While developing you may want to test only on node.js: ```sh -yarn test:node +yarn test ``` ...or only one test file: ```sh -yarn test:node test/some.test.js +yarn test test/some.test.js ``` ...or run each time a file changes: ```sh -yarn test:node:watch +yarn test:watch ``` ...or test only in a specific browser: diff --git a/karma.conf.js b/karma.conf.js index 268ef532b..b2f00b766 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -23,13 +23,7 @@ module.exports = function(config) { files: [ './packages/**/test/*.js', { - pattern: 'packages/**/test/samples/**/*', - watched: false, - included: false, - served: true - }, - { - pattern: 'packages/**/test/images/*', + pattern: 'packages/**/test/images/**/*', watched: false, included: false, served: true diff --git a/packages/jimp/test/async.test.js b/packages/jimp/test/async.test.js index 36353bf55..a5a3669ad 100644 --- a/packages/jimp/test/async.test.js +++ b/packages/jimp/test/async.test.js @@ -2,7 +2,7 @@ import fs from 'fs'; import should from 'should'; import { Jimp, getTestDir } from '@jimp/test-utils'; -const imagesDir = getTestDir(__dirname) + '/samples'; +const imagesDir = getTestDir(__dirname) + '/images'; describe('Async functions', () => { it('write returns promise', async () => { diff --git a/packages/jimp/test/composite.test.js b/packages/jimp/test/composite.test.js index 713c44de3..edbd2776f 100644 --- a/packages/jimp/test/composite.test.js +++ b/packages/jimp/test/composite.test.js @@ -11,8 +11,8 @@ const jimp = configure({ plugins: [plugins] }, Jimp); // TODO: Figure out why we need to write to file to get equal buffers describe('composite', () => { it('can apply more than one color transformation', async () => { - const image = getTestDir(__dirname) + '/samples/cops.jpg'; - const expectedImg = getTestDir(__dirname) + '/samples/cops-masked.jpg'; + const image = getTestDir(__dirname) + '/images/cops.jpg'; + const expectedImg = getTestDir(__dirname) + '/images/cops-masked.jpg'; if (process.env.ENV === 'browser') { return; @@ -39,7 +39,7 @@ describe('composite', () => { }); it('should handle edges correctly', async () => { - const image = getTestDir(__dirname) + '/samples/cops.jpg'; + const image = getTestDir(__dirname) + '/images/cops.jpg'; const testPath = image.replace('.jpg', '-test.jpg'); if (process.env.ENV === 'browser') { @@ -58,7 +58,7 @@ describe('composite', () => { await background.writeAsync(testPath); const one = fs.readFileSync( - getTestDir(__dirname) + '/samples/cops-composited.jpg' + getTestDir(__dirname) + '/images/cops-composited.jpg' ); const two = fs.readFileSync(testPath); diff --git a/packages/jimp/test/events.test.js b/packages/jimp/test/events.test.js index d064bd3a5..fd608c23c 100644 --- a/packages/jimp/test/events.test.js +++ b/packages/jimp/test/events.test.js @@ -17,7 +17,7 @@ describe('Events', () => { }); it('initializes with a file', done => { - new Jimp(getTestDir(__dirname) + '/samples/lenna.png') + new Jimp(getTestDir(__dirname) + '/images/lenna.png') .on('initialized', function() { this.bitmap.width.should.be.equal(512); done(); diff --git a/packages/jimp/test/exif.test.js b/packages/jimp/test/exif.test.js index 597478e31..0b6ffe444 100644 --- a/packages/jimp/test/exif.test.js +++ b/packages/jimp/test/exif.test.js @@ -7,7 +7,7 @@ const jimp = configure({ plugins: [plugins] }, Jimp); describe('Exif', function() { this.timeout(15000); - const imagesDir = getTestDir(__dirname) + '/samples/exif-orientation'; + const imagesDir = getTestDir(__dirname) + '/images/exif-orientation'; let imgs; let firstLandscapeImg; diff --git a/packages/jimp/test/filetypes.test.js b/packages/jimp/test/filetypes.test.js index 6cd04455e..29f8722c4 100644 --- a/packages/jimp/test/filetypes.test.js +++ b/packages/jimp/test/filetypes.test.js @@ -5,7 +5,7 @@ import should from 'should'; import { Jimp, getTestDir } from '@jimp/test-utils'; describe('FileType', () => { - const imagesDir = getTestDir(__dirname) + '/samples'; + const imagesDir = getTestDir(__dirname) + '/images'; it('write uses original MIME type', async () => { if (process.env.ENV === 'browser') { @@ -128,10 +128,10 @@ describe('FileType', () => { this.timeout(4000); const expectedImg = await Jimp.read( - getTestDir(__dirname) + '/samples/windows95.png' + getTestDir(__dirname) + '/images/windows95.png' ); const image = await Jimp.read( - getTestDir(__dirname) + '/samples/windows95.bmp' + getTestDir(__dirname) + '/images/windows95.bmp' ); image.bitmap.data.should.be.deepEqual(expectedImg.bitmap.data); diff --git a/packages/jimp/test/hash.test.js b/packages/jimp/test/hash.test.js index 0d292e45e..3e7b94ffd 100644 --- a/packages/jimp/test/hash.test.js +++ b/packages/jimp/test/hash.test.js @@ -7,7 +7,7 @@ import plugins from '@jimp/plugins'; const jimp = configure({ plugins: [plugins] }, Jimp); describe('hash', () => { - const imagesDir = getTestDir(__dirname) + '/samples'; + const imagesDir = getTestDir(__dirname) + '/images'; it('base 2', async () => { const image = await jimp.read(imagesDir + '/dice.png'); diff --git a/packages/jimp/test/samples/cops-composited.jpg b/packages/jimp/test/images/cops-composited.jpg similarity index 100% rename from packages/jimp/test/samples/cops-composited.jpg rename to packages/jimp/test/images/cops-composited.jpg diff --git a/packages/jimp/test/samples/cops-masked.jpg b/packages/jimp/test/images/cops-masked.jpg similarity index 100% rename from packages/jimp/test/samples/cops-masked.jpg rename to packages/jimp/test/images/cops-masked.jpg diff --git a/packages/jimp/test/samples/cops.jpg b/packages/jimp/test/images/cops.jpg similarity index 100% rename from packages/jimp/test/samples/cops.jpg rename to packages/jimp/test/images/cops.jpg diff --git a/packages/jimp/test/samples/dice.png b/packages/jimp/test/images/dice.png similarity index 100% rename from packages/jimp/test/samples/dice.png rename to packages/jimp/test/images/dice.png diff --git a/packages/jimp/test/samples/exif-orientation/LICENSE b/packages/jimp/test/images/exif-orientation/LICENSE similarity index 100% rename from packages/jimp/test/samples/exif-orientation/LICENSE rename to packages/jimp/test/images/exif-orientation/LICENSE diff --git a/packages/jimp/test/samples/exif-orientation/Landscape_1.jpg b/packages/jimp/test/images/exif-orientation/Landscape_1.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Landscape_1.jpg rename to packages/jimp/test/images/exif-orientation/Landscape_1.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Landscape_2.jpg b/packages/jimp/test/images/exif-orientation/Landscape_2.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Landscape_2.jpg rename to packages/jimp/test/images/exif-orientation/Landscape_2.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Landscape_3.jpg b/packages/jimp/test/images/exif-orientation/Landscape_3.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Landscape_3.jpg rename to packages/jimp/test/images/exif-orientation/Landscape_3.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Landscape_4.jpg b/packages/jimp/test/images/exif-orientation/Landscape_4.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Landscape_4.jpg rename to packages/jimp/test/images/exif-orientation/Landscape_4.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Landscape_5.jpg b/packages/jimp/test/images/exif-orientation/Landscape_5.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Landscape_5.jpg rename to packages/jimp/test/images/exif-orientation/Landscape_5.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Landscape_6.jpg b/packages/jimp/test/images/exif-orientation/Landscape_6.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Landscape_6.jpg rename to packages/jimp/test/images/exif-orientation/Landscape_6.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Landscape_7.jpg b/packages/jimp/test/images/exif-orientation/Landscape_7.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Landscape_7.jpg rename to packages/jimp/test/images/exif-orientation/Landscape_7.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Landscape_8.jpg b/packages/jimp/test/images/exif-orientation/Landscape_8.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Landscape_8.jpg rename to packages/jimp/test/images/exif-orientation/Landscape_8.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Portrait_1.jpg b/packages/jimp/test/images/exif-orientation/Portrait_1.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Portrait_1.jpg rename to packages/jimp/test/images/exif-orientation/Portrait_1.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Portrait_2.jpg b/packages/jimp/test/images/exif-orientation/Portrait_2.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Portrait_2.jpg rename to packages/jimp/test/images/exif-orientation/Portrait_2.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Portrait_3.jpg b/packages/jimp/test/images/exif-orientation/Portrait_3.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Portrait_3.jpg rename to packages/jimp/test/images/exif-orientation/Portrait_3.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Portrait_4.jpg b/packages/jimp/test/images/exif-orientation/Portrait_4.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Portrait_4.jpg rename to packages/jimp/test/images/exif-orientation/Portrait_4.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Portrait_5.jpg b/packages/jimp/test/images/exif-orientation/Portrait_5.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Portrait_5.jpg rename to packages/jimp/test/images/exif-orientation/Portrait_5.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Portrait_6.jpg b/packages/jimp/test/images/exif-orientation/Portrait_6.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Portrait_6.jpg rename to packages/jimp/test/images/exif-orientation/Portrait_6.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Portrait_7.jpg b/packages/jimp/test/images/exif-orientation/Portrait_7.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Portrait_7.jpg rename to packages/jimp/test/images/exif-orientation/Portrait_7.jpg diff --git a/packages/jimp/test/samples/exif-orientation/Portrait_8.jpg b/packages/jimp/test/images/exif-orientation/Portrait_8.jpg similarity index 100% rename from packages/jimp/test/samples/exif-orientation/Portrait_8.jpg rename to packages/jimp/test/images/exif-orientation/Portrait_8.jpg diff --git a/packages/jimp/test/samples/exif-orientation/README.markdown b/packages/jimp/test/images/exif-orientation/README.markdown similarity index 100% rename from packages/jimp/test/samples/exif-orientation/README.markdown rename to packages/jimp/test/images/exif-orientation/README.markdown diff --git a/packages/jimp/test/samples/exif-orientation/VERSION b/packages/jimp/test/images/exif-orientation/VERSION similarity index 100% rename from packages/jimp/test/samples/exif-orientation/VERSION rename to packages/jimp/test/images/exif-orientation/VERSION diff --git a/packages/jimp/test/samples/fillbytes.jpg b/packages/jimp/test/images/fillbytes.jpg similarity index 100% rename from packages/jimp/test/samples/fillbytes.jpg rename to packages/jimp/test/images/fillbytes.jpg diff --git a/packages/jimp/test/samples/lenna.png b/packages/jimp/test/images/lenna.png similarity index 100% rename from packages/jimp/test/samples/lenna.png rename to packages/jimp/test/images/lenna.png diff --git a/packages/jimp/test/samples/mask.png b/packages/jimp/test/images/mask.png similarity index 100% rename from packages/jimp/test/samples/mask.png rename to packages/jimp/test/images/mask.png diff --git a/packages/jimp/test/samples/panoramic.jpg b/packages/jimp/test/images/panoramic.jpg similarity index 100% rename from packages/jimp/test/samples/panoramic.jpg rename to packages/jimp/test/images/panoramic.jpg diff --git a/packages/jimp/test/samples/rgb.tiff b/packages/jimp/test/images/rgb.tiff similarity index 100% rename from packages/jimp/test/samples/rgb.tiff rename to packages/jimp/test/images/rgb.tiff diff --git a/packages/jimp/test/samples/windows95.bmp b/packages/jimp/test/images/windows95.bmp similarity index 100% rename from packages/jimp/test/samples/windows95.bmp rename to packages/jimp/test/images/windows95.bmp diff --git a/packages/jimp/test/samples/windows95.png b/packages/jimp/test/images/windows95.png similarity index 100% rename from packages/jimp/test/samples/windows95.png rename to packages/jimp/test/images/windows95.png