Skip to content
This repository has been archived by the owner on Oct 28, 2019. It is now read-only.

Commit

Permalink
✅ test: Add tests and CI script
Browse files Browse the repository at this point in the history
  • Loading branch information
motss committed Apr 21, 2019
1 parent a4f1fd1 commit f02bad0
Show file tree
Hide file tree
Showing 25 changed files with 777 additions and 3,653 deletions.
207 changes: 207 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,207 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2

aliases:
- &restore-cache-deps
key: dependency-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ checksum "package.json" }}-2
- &save-cache-deps
key: dependency-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ checksum "package.json" }}-2
paths:
- node_modules

defaults: &defaults
working_directory: ~/really-clipboard-copy
docker:
- image: circleci/node:8-browsers

jobs:
build:
<<: *defaults
steps:
- checkout
- restore_cache: *restore-cache-deps
- run:
name: Install Global Dependencies
command: sudo npm i -g npm@latest --quiet
- run:
name: Install Dependencies
command: npm ci --quiet
- save_cache: *save-cache-deps
- run:
name: Versions
command: node -v && npm version && which npm && pwd
- run:
name: Lint
command: npm run lint
- run:
name: Build
command: npm run ts
- persist_to_workspace:
root: ~/really-clipboard-copy
paths:
- "*"

test_local:
<<: *defaults
steps:
- attach_workspace:
at: ~/really-clipboard-copy
- run:
name: Test
command: npx -p web-component-tester -- npm run test:ci

test_ie_11:
<<: *defaults
steps:
- attach_workspace:
at: ~/really-clipboard-copy
- run:
name: Test (Internet Explorer 11)
command: |
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
npx -p web-component-tester -- npm run test:sl -- -s 'windows 7/internet explorer@11';
fi
test_edge_17:
<<: *defaults
steps:
- attach_workspace:
at: ~/really-clipboard-copy
- run:
name: Test (Edge 17)
command: |
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
npx -p web-component-tester -- npm run test:sl -- -s 'windows 10/microsoftedge@17';
fi
test_edge_13:
<<: *defaults
steps:
- attach_workspace:
at: ~/really-clipboard-copy
- run:
name: Test (Edge 13)
command: |
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
npx -p web-component-tester -- npm run test:sl -- -s 'windows 10/microsoftedge@13';
fi
test_safari_10_1:
<<: *defaults
steps:
- attach_workspace:
at: ~/really-clipboard-copy
- run:
name: Test (Safari 10.1)
command: |
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
npx -p web-component-tester -- npm run test:sl -- -s 'macos 10.12/safari@10.1';
fi
test_safari_9:
<<: *defaults
steps:
- attach_workspace:
at: ~/really-clipboard-copy
- run:
name: Test (Safari 9)
command: |
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
npx -p web-component-tester -- npm run test:sl -- -s 'os x 10.11/safari@9';
fi
test_chrome_69:
<<: *defaults
steps:
- attach_workspace:
at: ~/really-clipboard-copy
- run:
name: Test (Chrome 69)
command: |
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
npx -p web-component-tester -- npm run test:sl -- -s 'windows 10/chrome@69';
fi
test_chrome_41:
<<: *defaults
steps:
- attach_workspace:
at: ~/really-clipboard-copy
- run:
name: Test (Chrome 41)
command: |
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
npx -p web-component-tester -- npm run test:sl -- -s 'Linux/chrome@41';
fi
test_firefox_63:
<<: *defaults
steps:
- attach_workspace:
at: ~/really-clipboard-copy
- run:
name: Test (Firefox 63)
command: |
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
npx -p web-component-tester -- npm run test:sl -- -s 'windows 10/firefox@63';
fi
test_firefox_62:
<<: *defaults
steps:
- attach_workspace:
at: ~/really-clipboard-copy
- run:
name: Test (Firefox 62)
command: |
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
npx -p web-component-tester -- npm run test:sl -- -s 'macos 10.14/firefox@62';
fi
workflows:
version: 2
node-multi-build:
jobs:
- build
- test_local:
requires:
- build

- test_ie_11:
requires:
- build

- test_edge_17:
requires:
- build
- test_edge_13:
requires:
- build
- test_edge_17

- test_safari_10_1:
requires:
- build
- test_safari_9:
requires:
- build
- test_safari_10_1

- test_chrome_69:
requires:
- build
- test_chrome_41:
requires:
- build
- test_chrome_69

- test_firefox_63:
requires:
- build
- test_firefox_62:
requires:
- build
- test_firefox_63
49 changes: 1 addition & 48 deletions README.md
@@ -1,7 +1,7 @@
<div align="center" style="text-align: center;">
<h1 style="border-bottom: none;">really-clipboard-copy</h1>

<p>Really custom element to copy content to clipboard</p>
<p>Copy content to clipboard</p>
</div>

<hr />
Expand Down Expand Up @@ -33,8 +33,6 @@
- [Pre-requisites](#pre-requisites)
- [Installation](#installation)
- [Usage](#usage)
- [HTML (with native ES modules)](#html-with-native-es-modules)
- [JS/ TS file (w/ native ES modules)](#js-ts-file-w-native-es-modules)
- [License](#license)

## Pre-requisites
Expand All @@ -54,51 +52,6 @@ $ npm install really-clipboard-copy

## Usage

### HTML (with native ES modules)

```html
<!-- For the sake of brevity, the HTML below is just for reference -->
<!doctype html>
<html>
<head>
<!-- Native ES modules -->
<script type="module" src="/path/to/my-element.js"></script>
</head>

<body>
<!-- Element declaration -->
<my-element></my-element>
</body>
</html>
```

### JS/ TS file (w/ native ES modules)

```ts
import { css, html, LitElement } from 'lit-element';
import 'really-clipboard-copy.js';

class MainApp extends LitElement {
public static styles = [
css`
:host {
display: block;
}
* {
box-sizing: border-box;
}
`,
];

protected render() {
return html`
<my-element></my-element>
`;
}
}
```

## License

[MIT License](https://motss.mit-license.org/) © Rong Sen Ng (motss)
Expand Down
3 changes: 3 additions & 0 deletions api-references.md
@@ -0,0 +1,3 @@
# API References

## ReallyClipboardCopy
74 changes: 74 additions & 0 deletions code-of-conduct.md
@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at wes.ngrongsen@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [https://contributor-covenant.org/version/1/4][version]

[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/

0 comments on commit f02bad0

Please sign in to comment.