Skip to content

Commit

Permalink
Merge pull request #269 from robcresswell/chore/yarn-to-npm
Browse files Browse the repository at this point in the history
chore: yarn -> npm
  • Loading branch information
robcresswell authored Sep 18, 2021
2 parents 333baf3 + c8c0bdd commit ff7e570
Show file tree
Hide file tree
Showing 8 changed files with 13,633 additions and 4,869 deletions.
17 changes: 4 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,24 @@ defaults: &defaults
- image: cimg/node:lts
commands:
install_deps:
description: Install dependencies (from cache, if possible)
description: Install dependencies
steps:
- checkout
- restore_cache:
keys:
# when lock file changes, use increasingly general patterns to restore cache
- yarn-{{ checksum "yarn.lock" }}
- yarn-
- run: yarn --frozen-lockfile
- save_cache:
paths:
- ~/.cache/yarn
key: yarn-{{ checksum "yarn.lock" }}
- run: npm ci
jobs:
test:
<<: *defaults
steps:
- install_deps
- run: yarn build
- run: npm run build
- run: ./node_modules/.bin/jest --runInBand --ci
- store_test_results:
path: reports
release:
<<: *defaults
steps:
- install_deps
- run: yarn build
- run: npm run build
- run: npx semantic-release
workflows:
version: 2
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ node_modules/
*.log
*.tgz
dist/
package-lock.json
coverage/
reports/
reports/
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package-lock=false
audit=false
fund=false
16 changes: 8 additions & 8 deletions __tests__/icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ describe('Icon', () => {
icon = mount(WrappedIcon);
});

it('accepts a "title" property', () => {
it('accepts a "title" property', async () => {
expect(icon.attributes()['aria-label']).toEqual('Android icon');

icon.setProps({ title: 'foo' });
await icon.setProps({ title: 'foo' });

expect(icon.attributes()['aria-label']).toEqual('foo');
});

it('accepts a "decorative" property', () => {
it('accepts a "decorative" property', async () => {
expect(icon.attributes()['aria-hidden']).toBeFalsy();

icon.setProps({ decorative: true });
await icon.setProps({ decorative: true });

expect(icon.attributes()['aria-hidden']).toBeTruthy();
});

it('accepts a "fillColor" property', () => {
it('accepts a "fillColor" property', async () => {
const svg = icon.find('.material-design-icon__svg');

expect(svg.attributes()['fill']).toEqual('currentColor');

icon.setProps({ fillColor: '#FF0000' });
await icon.setProps({ fillColor: '#FF0000' });

expect(svg.attributes()['fill']).toEqual('#FF0000');
});
Expand All @@ -50,7 +50,7 @@ describe('Icon', () => {
expect(icon).toMatchSnapshot();
});

it('listens to a click event', () => {
it('listens to a click event', async () => {
const clickListener = jest.fn();
const iconWithEvent = mount({
name: 'IconWithEvent',
Expand All @@ -65,7 +65,7 @@ describe('Icon', () => {
},
});

iconWithEvent.trigger('click');
await iconWithEvent.trigger('click');
expect(clickListener).toBeCalled();
});
});
5 changes: 1 addition & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
module.exports = {
verbose: true,
testEnvironment: 'jsdom',
moduleFileExtensions: ['js', 'vue'],
transform: {
'^.+\\.vue$': 'vue-jest',
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
},
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
reporters: [
'default',
['jest-junit', { outputDirectory: '<rootDir>/reports/jest' }],
],
};
Loading

0 comments on commit ff7e570

Please sign in to comment.