feat: add prettier lint scripts and workflow (#3546)
* feat: add lint scripts and workflow Signed-off-by: kushthedude <kushthedude@gmail.com> * fix lint Signed-off-by: kushthedude <kushthedude@gmail.com>
This commit is contained in:
parent
54f438721e
commit
6750a45d53
5
.github/workflows/pull_request.yml
vendored
5
.github/workflows/pull_request.yml
vendored
@ -130,6 +130,11 @@ jobs:
|
||||
npm i -g yarn
|
||||
yarn install
|
||||
|
||||
- name: Lint with Prettier
|
||||
run: |
|
||||
cd ./main/tests/cypress
|
||||
yarn check-lint
|
||||
|
||||
- name: Test with Cypress on ${{ matrix.browser }}
|
||||
run: |
|
||||
echo REFINE_MIN_MEMORY=1400M >> ./refine.ini
|
||||
|
@ -13,9 +13,9 @@ describe(__filename, function () {
|
||||
'BUTTER,WHIPPED,WITH SALT'
|
||||
)
|
||||
cy.getCell(1, 'Shrt_Desc').should('to.contain', 'BUTTER,WITH SALT')
|
||||
|
||||
|
||||
cy.columnActionClick('Shrt_Desc', ['Sort', 'Reverse'])
|
||||
|
||||
|
||||
cy.getCell(0, 'Shrt_Desc').should('to.contain', 'BUTTER,WITH SALT')
|
||||
cy.getCell(1, 'Shrt_Desc').should(
|
||||
'to.contain',
|
||||
@ -33,7 +33,7 @@ describe(__filename, function () {
|
||||
it('Perform a number sort + Reverse + Remove', function () {
|
||||
cy.loadAndVisitProject('food.sort')
|
||||
|
||||
cy.castColumnTo('NDB_No','number')
|
||||
cy.castColumnTo('NDB_No', 'number')
|
||||
cy.columnActionClick('NDB_No', ['Sort'])
|
||||
|
||||
cy.waitForDialogPanel()
|
||||
@ -54,7 +54,7 @@ describe(__filename, function () {
|
||||
it('Perform a date sort + Reverse + Remove', function () {
|
||||
cy.loadAndVisitProject('food.sort')
|
||||
|
||||
cy.castColumnTo('Date','date')
|
||||
cy.castColumnTo('Date', 'date')
|
||||
cy.columnActionClick('Date', ['Sort'])
|
||||
|
||||
cy.waitForDialogPanel()
|
||||
@ -65,7 +65,7 @@ describe(__filename, function () {
|
||||
// ensure sorting is active
|
||||
cy.getCell(0, 'Date').should('to.contain', '2020-12-17T00:00:00Z')
|
||||
cy.getCell(1, 'Date').should('to.contain', '2020-08-17T00:00:00Z')
|
||||
|
||||
|
||||
cy.columnActionClick('Date', ['Sort', 'Reverse'])
|
||||
|
||||
cy.getCell(0, 'Date').should('to.contain', '2020-08-17T00:00:00Z')
|
||||
@ -74,7 +74,6 @@ describe(__filename, function () {
|
||||
cy.columnActionClick('Date', ['Sort', 'Remove sort'])
|
||||
cy.getCell(0, 'Date').should('to.contain', '2020-12-17T00:00:00Z')
|
||||
cy.getCell(1, 'Date').should('to.contain', '2020-08-17T00:00:00Z')
|
||||
|
||||
})
|
||||
it('Perform a bool sort + Reverse + Remove', function () {
|
||||
cy.loadAndVisitProject('food.sort')
|
||||
|
@ -31,7 +31,7 @@ describe(__filename, function () {
|
||||
it('Ensure it reverses and reorders number sort', function () {
|
||||
cy.loadAndVisitProject('food.sort')
|
||||
|
||||
cy.castColumnTo('NDB_No','number')
|
||||
cy.castColumnTo('NDB_No', 'number')
|
||||
cy.columnActionClick('NDB_No', ['Sort'])
|
||||
|
||||
cy.waitForDialogPanel()
|
||||
@ -56,7 +56,7 @@ describe(__filename, function () {
|
||||
it('Ensure it reverses and reorders date sort', function () {
|
||||
cy.loadAndVisitProject('food.sort')
|
||||
|
||||
cy.castColumnTo('Date','date')
|
||||
cy.castColumnTo('Date', 'date')
|
||||
cy.columnActionClick('Date', ['Sort'])
|
||||
|
||||
cy.waitForDialogPanel()
|
||||
|
@ -69,7 +69,24 @@ Cypress.Commands.add('loadProject', (fixture, projectName, tagName) => {
|
||||
// the following code can be used to inject tags in created projects
|
||||
// It's conflicting though, breaking up the CSV files
|
||||
// It is a hack to parse out CSV files in the openrefine while creating a project with tags
|
||||
const options = {"encoding":"US-ASCII","separator":",","ignoreLines":-1,"headerLines":1,"skipDataLines":0,"limit":-1,"storeBlankRows":true,"guessCellValueTypes":false,"processQuotes":true,"quoteCharacter":"\"","storeBlankCellsAsNulls":true,"includeFileSources":false,"includeArchiveFileName":false,"trimStrings":false,"projectName":openRefineProjectName,"projectTags": [tagName]}
|
||||
const options = {
|
||||
encoding: 'US-ASCII',
|
||||
separator: ',',
|
||||
ignoreLines: -1,
|
||||
headerLines: 1,
|
||||
skipDataLines: 0,
|
||||
limit: -1,
|
||||
storeBlankRows: true,
|
||||
guessCellValueTypes: false,
|
||||
processQuotes: true,
|
||||
quoteCharacter: '"',
|
||||
storeBlankCellsAsNulls: true,
|
||||
includeFileSources: false,
|
||||
includeArchiveFileName: false,
|
||||
trimStrings: false,
|
||||
projectName: openRefineProjectName,
|
||||
projectTags: [tagName],
|
||||
}
|
||||
var postData
|
||||
if (tagName == undefined) {
|
||||
postData =
|
||||
|
@ -5,6 +5,11 @@
|
||||
"license": "BSD-3-Clause",
|
||||
"author": "OpenRefine",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "cypress run --browser electron --headless --quiet",
|
||||
"lint": "prettier --write .",
|
||||
"check-lint": "prettier --check ."
|
||||
},
|
||||
"dependencies": {
|
||||
"cypress": "6.2.1",
|
||||
"cypress-file-upload": "^5.0.2",
|
||||
|
Loading…
Reference in New Issue
Block a user