-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore!: changed crittr to ESM fix: tests where also transformed and fixed chore: added conventional commits with release-please for versioning chore!: Minimum nodejs version is 18 chore: updated dependecies to newest versions
- Loading branch information
1 parent
0786481
commit b7ec137
Showing
30 changed files
with
12,532 additions
and
3,647 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ tmp/* | |
yarn-error.log | ||
test.js | ||
.vscode | ||
test/screenshots | ||
test/results/* | ||
!test/results/.gitkeep | ||
test/*.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,34 @@ | ||
'use strict'; | ||
global.crittr_project_path = __dirname; | ||
|
||
const log = require('signale'); | ||
const path = require('path'); | ||
import { createRequire } from 'node:module'; | ||
import log from '@dynamicabot/signales'; | ||
import path from 'path'; | ||
import url from 'url'; | ||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); | ||
const NODE_ENV = process.env.NODE_ENV || 'production'; | ||
|
||
let IS_NPM_PACKAGE = false; | ||
try { | ||
const require = createRequire(import.meta.url); | ||
IS_NPM_PACKAGE = !!require.resolve('crittr'); | ||
} catch (e) {} | ||
|
||
const pathToCrittr = NODE_ENV === 'development' && !IS_NPM_PACKAGE ? 'lib' : 'lib'; // Only keep for later browser support? | ||
const Crittr = require(path.join(__dirname, pathToCrittr, 'classes', 'Crittr.class.js')); | ||
|
||
/** | ||
* | ||
* @param options | ||
* @returns {Promise<[<string>, <string>]>} | ||
*/ | ||
module.exports = options => { | ||
return new Promise(async (resolve, reject) => { | ||
log.time('Crittr Run'); | ||
export default async options => { | ||
log.time('Crittr Run'); | ||
const { Crittr } = await import(path.join(__dirname, pathToCrittr, 'classes', 'Crittr.class.js')); | ||
|
||
let crittr; | ||
let resultObj = { critical: null, rest: null }; | ||
|
||
let crittr; | ||
let resultObj = { critical: null, rest: null }; | ||
crittr = new Crittr(options); | ||
|
||
try { | ||
crittr = new Crittr(options); | ||
} catch (err) { | ||
reject(err); | ||
} | ||
resultObj = await crittr.run(); | ||
|
||
try { | ||
resultObj = await crittr.run(); | ||
} catch (err) { | ||
reject(err); | ||
} | ||
resolve(resultObj); | ||
log.timeEnd('Crittr Run'); | ||
}); | ||
log.timeEnd('Crittr Run'); | ||
return resultObj; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
// jest.config.js | ||
module.exports = { | ||
export default { | ||
projects: [ | ||
{ | ||
displayName: 'Basic', | ||
globalSetup: './test/setup.cjs', | ||
globalTeardown: './test/teardown.cjs', | ||
globalSetup: './test/setup.js', | ||
globalTeardown: './test/teardown.js', | ||
roots: ['<rootDir>'], | ||
testMatch: ['**/test/tests/**/*.test.cjs?(x)'], | ||
testMatch: ['**/test/tests/**/*.test.js?(x)'], | ||
testEnvironmentOptions: { | ||
url: 'http://localhost', | ||
}, | ||
}, | ||
], | ||
transform: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.