build: resolve Quantize dep issue, upgrade Cypress

This commit is contained in:
Lokesh Dhakar
2023-02-27 15:30:44 -08:00
parent ef231c7113
commit 20d3593422
18 changed files with 9764 additions and 8270 deletions

13
cypress.config.js Normal file
View 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,
},
})

View File

@@ -1 +0,0 @@
{}

View File

@@ -8,8 +8,8 @@ function rgbCount(text) {
return vals.length / 3
}
describe('getColor()', function() {
before(function() {
describe('getColor()', { testIsolation: false }, function() {
before(function() {
cy.visit('http://localhost:8080/cypress/test-pages/index.html');
})
@@ -18,7 +18,7 @@ describe('getColor()', function() {
const count = rgbCount($el.text())
expect(count).to.equal(1);
});
})
})
it('returns valid color from red image', function() {
cy.get('[data-image="red.png"] .output-color').should(($el) => {

Binary file not shown.

Binary file not shown.

Binary file not shown.

2
dist/color-thief.js vendored
View File

@@ -1,5 +1,5 @@
const getPixels = require('get-pixels');
const quantize = require('quantize');
const quantize = require('@lokesh.dhakar/quantize');
function createPixelArray(imgData, pixelCount, quality) {
const pixels = imgData;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
dist/color-thief.modern.mjs vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

17986
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -32,23 +32,24 @@
"watch": "microbundle watch --no-sourcemap",
"dev": "http-server",
"test": "mocha && cypress run --config video=false",
"test:browser": "cypress open",
"test:node": "mocha"
"test:browser": "./node_modules/.bin/cypress run --headed --browser chrome",
"test:node": "mocha",
"cypress": "./node_modules/.bin/cypress open"
},
"devDependencies": {
"@node-minify/core": "^4.0.5",
"@node-minify/uglify-es": "^4.0.5",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"cypress": "^3.4.0",
"cypress": "^12.6.0",
"eslint": "^5.16.0",
"http-server": "^0.11.1",
"microbundle": "^0.11.0",
"microbundle": "^0.15.0",
"mocha": "^6.2.0",
"mustache": "^3.0.1"
},
"dependencies": {
"get-pixels": "^3.3.2",
"quantize": "github:lokesh/quantize"
"@lokesh.dhakar/quantize": "^1.3.0",
"get-pixels": "^3.3.2"
}
}

View File

@@ -1,5 +1,5 @@
const getPixels = require('get-pixels');
const quantize = require('quantize');
const quantize = require('@lokesh.dhakar/quantize');
function createPixelArray(imgData, pixelCount, quality) {
const pixels = imgData;

View File

@@ -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';
/*