diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index db04bab..0677849 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -16,9 +16,6 @@ jobs: env: CI: true - - name: Install prettier - run: yarn global add prettier - - name: Run prettier run: yarn run prettier --write 'src/**/*.js' 'tests/**/*.js' diff --git a/package-lock.json b/package-lock.json index 969d978..8c16d09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "iodine", - "version": "1.0.0", + "name": "@kingshott/iodine", + "version": "3.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -7529,6 +7529,12 @@ "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", "dev": true }, + "prettier": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "dev": true + }, "pretty-bytes": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.3.0.tgz", diff --git a/package.json b/package.json index 8050a3f..3f7751b 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@babel/preset-env": "^7.9.0", "babel-jest": "^25.2.4", "jest": "^25.2.4", - "microbundle": "^0.11.0" + "microbundle": "^0.11.0", + "prettier": "^2.0.5" } -} \ No newline at end of file +} diff --git a/tests/test.js b/tests/test.js index 34f656a..8883f42 100644 --- a/tests/test.js +++ b/tests/test.js @@ -397,15 +397,15 @@ test('it validates values against multiple rules', () => { * **/ test('it retrieves formatted error messages for rules', () => { - let time = Date.UTC(2020, 4, 2, 3, 17, 0); + let time = Date.UTC(2020, 4, 2, 10, 17, 0); Iodine.setLocale('en-US'); - let hour = new Date().getTimezoneOffset() === -60 ? 4 : 3; + let hour = new Date().getTimezoneOffset() === -60 ? 11 : 10; expect(Iodine.getErrorMessage('array')).toBe('Value must be an array'); expect(Iodine.getErrorMessage('endingWith')).toBe(`Value must end with '[PARAM]'`); expect(Iodine.getErrorMessage('endingWith:world')).toBe(`Value must end with 'world'`); expect(Iodine.getErrorMessage('endingWith', 'world')).toBe(`Value must end with 'world'`); - expect(Iodine.getErrorMessage(`after:${time}`)).toBe(`The date must be after: 'May 2, 2020, 0${hour}:17 AM'`); - expect(Iodine.getErrorMessage(`after`, time)).toBe(`The date must be after: 'May 2, 2020, 0${hour}:17 AM'`); + expect(Iodine.getErrorMessage(`after:${time}`)).toBe(`The date must be after: 'May 2, 2020, ${hour}:17 AM'`); + expect(Iodine.getErrorMessage(`after`, time)).toBe(`The date must be after: 'May 2, 2020, ${hour}:17 AM'`); });