mirror of
https://github.com/janishutz/color-thief.git
synced 2025-11-25 13:54:25 +00:00
build: resolve Quantize dep issue, upgrade Cypress
This commit is contained in:
13
cypress.config.js
Normal file
13
cypress.config.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
const { defineConfig } = require('cypress')
|
||||||
|
|
||||||
|
module.exports = defineConfig({
|
||||||
|
e2e: {
|
||||||
|
// We've imported your old cypress plugins here.
|
||||||
|
// You may want to clean this up later by importing these.
|
||||||
|
setupNodeEvents(on, config) {
|
||||||
|
return require('./cypress/plugins/index.js')(on, config)
|
||||||
|
},
|
||||||
|
|
||||||
|
experimentalRunAllSpecs: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -1 +0,0 @@
|
|||||||
{}
|
|
||||||
@@ -8,8 +8,8 @@ function rgbCount(text) {
|
|||||||
return vals.length / 3
|
return vals.length / 3
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('getColor()', function() {
|
describe('getColor()', { testIsolation: false }, function() {
|
||||||
before(function() {
|
before(function() {
|
||||||
cy.visit('http://localhost:8080/cypress/test-pages/index.html');
|
cy.visit('http://localhost:8080/cypress/test-pages/index.html');
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ describe('getColor()', function() {
|
|||||||
const count = rgbCount($el.text())
|
const count = rgbCount($el.text())
|
||||||
expect(count).to.equal(1);
|
expect(count).to.equal(1);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns valid color from red image', function() {
|
it('returns valid color from red image', function() {
|
||||||
cy.get('[data-image="red.png"] .output-color').should(($el) => {
|
cy.get('[data-image="red.png"] .output-color').should(($el) => {
|
||||||
BIN
cypress/videos/api.cy.js.mp4
Normal file
BIN
cypress/videos/api.cy.js.mp4
Normal file
Binary file not shown.
BIN
cypress/videos/cors.cy.js.mp4
Normal file
BIN
cypress/videos/cors.cy.js.mp4
Normal file
Binary file not shown.
BIN
cypress/videos/module.cy.js.mp4
Normal file
BIN
cypress/videos/module.cy.js.mp4
Normal file
Binary file not shown.
2
dist/color-thief.js
vendored
2
dist/color-thief.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
const getPixels = require('get-pixels');
|
const getPixels = require('get-pixels');
|
||||||
const quantize = require('quantize');
|
const quantize = require('@lokesh.dhakar/quantize');
|
||||||
|
|
||||||
function createPixelArray(imgData, pixelCount, quality) {
|
function createPixelArray(imgData, pixelCount, quality) {
|
||||||
const pixels = imgData;
|
const pixels = imgData;
|
||||||
|
|||||||
2
dist/color-thief.min.js
vendored
2
dist/color-thief.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/color-thief.mjs
vendored
2
dist/color-thief.mjs
vendored
File diff suppressed because one or more lines are too long
1
dist/color-thief.modern.mjs
vendored
Normal file
1
dist/color-thief.modern.mjs
vendored
Normal file
File diff suppressed because one or more lines are too long
2
dist/color-thief.umd.js
vendored
2
dist/color-thief.umd.js
vendored
File diff suppressed because one or more lines are too long
17986
package-lock.json
generated
17986
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
13
package.json
13
package.json
@@ -32,23 +32,24 @@
|
|||||||
"watch": "microbundle watch --no-sourcemap",
|
"watch": "microbundle watch --no-sourcemap",
|
||||||
"dev": "http-server",
|
"dev": "http-server",
|
||||||
"test": "mocha && cypress run --config video=false",
|
"test": "mocha && cypress run --config video=false",
|
||||||
"test:browser": "cypress open",
|
"test:browser": "./node_modules/.bin/cypress run --headed --browser chrome",
|
||||||
"test:node": "mocha"
|
"test:node": "mocha",
|
||||||
|
"cypress": "./node_modules/.bin/cypress open"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@node-minify/core": "^4.0.5",
|
"@node-minify/core": "^4.0.5",
|
||||||
"@node-minify/uglify-es": "^4.0.5",
|
"@node-minify/uglify-es": "^4.0.5",
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"chai-as-promised": "^7.1.1",
|
"chai-as-promised": "^7.1.1",
|
||||||
"cypress": "^3.4.0",
|
"cypress": "^12.6.0",
|
||||||
"eslint": "^5.16.0",
|
"eslint": "^5.16.0",
|
||||||
"http-server": "^0.11.1",
|
"http-server": "^0.11.1",
|
||||||
"microbundle": "^0.11.0",
|
"microbundle": "^0.15.0",
|
||||||
"mocha": "^6.2.0",
|
"mocha": "^6.2.0",
|
||||||
"mustache": "^3.0.1"
|
"mustache": "^3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"get-pixels": "^3.3.2",
|
"@lokesh.dhakar/quantize": "^1.3.0",
|
||||||
"quantize": "github:lokesh/quantize"
|
"get-pixels": "^3.3.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const getPixels = require('get-pixels');
|
const getPixels = require('get-pixels');
|
||||||
const quantize = require('quantize');
|
const quantize = require('@lokesh.dhakar/quantize');
|
||||||
|
|
||||||
function createPixelArray(imgData, pixelCount, quality) {
|
function createPixelArray(imgData, pixelCount, quality) {
|
||||||
const pixels = imgData;
|
const pixels = imgData;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import quantize from '../node_modules/quantize/dist/index.mjs';
|
import quantize from '../node_modules/@lokesh.dhakar/quantize/dist/index.mjs';
|
||||||
import core from './core.js';
|
import core from './core.js';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user