mirror of
https://github.com/tauri-apps/board-voter.git
synced 2026-01-31 00:55:20 +01:00
chore: prettier in the root
This commit is contained in:
6
.prettierignore
Normal file
6
.prettierignore
Normal file
@@ -0,0 +1,6 @@
|
||||
.nuxt
|
||||
Cargo.lock
|
||||
dist
|
||||
node_modules
|
||||
pnpm-lock.yaml
|
||||
target
|
||||
@@ -1,32 +1,32 @@
|
||||
// calculates the luma from a hex color `#abcdef`
|
||||
function luma(hex) {
|
||||
if (hex.startsWith('#')) {
|
||||
hex = hex.substring(1)
|
||||
if (hex.startsWith("#")) {
|
||||
hex = hex.substring(1);
|
||||
}
|
||||
|
||||
const rgb = parseInt(hex, 16)
|
||||
const r = (rgb >> 16) & 0xff
|
||||
const g = (rgb >> 8) & 0xff
|
||||
const b = (rgb >> 0) & 0xff
|
||||
return 0.2126 * r + 0.7152 * g + 0.0722 * b
|
||||
const rgb = parseInt(hex, 16);
|
||||
const r = (rgb >> 16) & 0xff;
|
||||
const g = (rgb >> 8) & 0xff;
|
||||
const b = (rgb >> 0) & 0xff;
|
||||
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
||||
}
|
||||
|
||||
describe('Hello Tauri', () => {
|
||||
it('should be cordial', async () => {
|
||||
const header = await $('body > h1')
|
||||
const text = await header.getText()
|
||||
expect(text).toMatch(/^[hH]ello/)
|
||||
})
|
||||
describe("Hello Tauri", () => {
|
||||
it("should be cordial", async () => {
|
||||
const header = await $("body > h1");
|
||||
const text = await header.getText();
|
||||
expect(text).toMatch(/^[hH]ello/);
|
||||
});
|
||||
|
||||
it('should be excited', async () => {
|
||||
const header = await $('body > h1')
|
||||
const text = await header.getText()
|
||||
expect(text).toMatch(/!$/)
|
||||
})
|
||||
it("should be excited", async () => {
|
||||
const header = await $("body > h1");
|
||||
const text = await header.getText();
|
||||
expect(text).toMatch(/!$/);
|
||||
});
|
||||
|
||||
it('should be easy on the eyes', async () => {
|
||||
const body = await $('body')
|
||||
const backgroundColor = await body.getCSSProperty('background-color')
|
||||
expect(luma(backgroundColor.parsed.hex)).toBeLessThan(100)
|
||||
})
|
||||
})
|
||||
it("should be easy on the eyes", async () => {
|
||||
const body = await $("body");
|
||||
const backgroundColor = await body.getCSSProperty("background-color");
|
||||
expect(luma(backgroundColor.parsed.hex)).toBeLessThan(100);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const { spawn, spawnSync } = require('child_process')
|
||||
const os = require("os");
|
||||
const path = require("path");
|
||||
const { spawn, spawnSync } = require("child_process");
|
||||
|
||||
// keep track of the `tauri-driver` child process
|
||||
let tauriDriver
|
||||
let tauriDriver;
|
||||
|
||||
exports.config = {
|
||||
specs: ['./tests/specs/**/*.js'],
|
||||
specs: ["./tests/specs/**/*.js"],
|
||||
maxInstances: 1,
|
||||
capabilities: [
|
||||
{
|
||||
maxInstances: 1,
|
||||
'tauri:options': {
|
||||
application: '../../target/debug/app',
|
||||
"tauri:options": {
|
||||
application: "../../target/debug/app",
|
||||
},
|
||||
},
|
||||
],
|
||||
reporters: ['spec'],
|
||||
framework: 'mocha',
|
||||
reporters: ["spec"],
|
||||
framework: "mocha",
|
||||
mochaOpts: {
|
||||
ui: 'bdd',
|
||||
ui: "bdd",
|
||||
timeout: 60000,
|
||||
},
|
||||
|
||||
// ensure the rust project is built since we expect this binary to exist for the webdriver sessions
|
||||
onPrepare: () => spawnSync('cargo', ['build']),
|
||||
onPrepare: () => spawnSync("cargo", ["build"]),
|
||||
|
||||
// ensure we are running `tauri-driver` before the session starts so that we can proxy the webdriver requests
|
||||
beforeSession: () =>
|
||||
(tauriDriver = spawn(
|
||||
path.resolve(os.homedir(), '.cargo', 'bin', 'tauri-driver'),
|
||||
path.resolve(os.homedir(), ".cargo", "bin", "tauri-driver"),
|
||||
[],
|
||||
{ stdio: [null, process.stdout, process.stderr] }
|
||||
)),
|
||||
|
||||
// clean up the `tauri-driver` process we spawned at the start of the session
|
||||
afterSession: () => tauriDriver.kill(),
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import './vuetify/main.scss';
|
||||
@import "./vuetify/main.scss";
|
||||
|
||||
html,
|
||||
body {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
@use 'vuetify/settings' with (
|
||||
@use "vuetify/settings" with (
|
||||
$utilities: yes
|
||||
);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@use 'vuetify' with (
|
||||
@use "vuetify" with (
|
||||
$utilities: yes,
|
||||
$color-pack: false
|
||||
);
|
||||
|
||||
11
package.json
Normal file
11
package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "board-voter-root",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"format": "prettier --write .",
|
||||
"format-check": "prettier --check ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "^2.8.8"
|
||||
}
|
||||
}
|
||||
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@@ -6,6 +6,12 @@ settings:
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
devDependencies:
|
||||
prettier:
|
||||
specifier: ^2.8.8
|
||||
version: 2.8.8
|
||||
|
||||
crates/backend:
|
||||
dependencies:
|
||||
'@tauri-apps/cli':
|
||||
@@ -6332,6 +6338,12 @@ packages:
|
||||
picocolors: 1.0.0
|
||||
source-map-js: 1.0.2
|
||||
|
||||
/prettier@2.8.8:
|
||||
resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==}
|
||||
engines: {node: '>=10.13.0'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/pretty-bytes@6.1.0:
|
||||
resolution: {integrity: sha512-Rk753HI8f4uivXi4ZCIYdhmG1V+WKzvRMg/X+M42a6t7D07RcmopXJMDNk6N++7Bl75URRGsb40ruvg7Hcp2wQ==}
|
||||
engines: {node: ^14.13.1 || >=16.0.0}
|
||||
|
||||
Reference in New Issue
Block a user