Skip to content

Commit

Permalink
ctp init module
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianMairinger committed Nov 17, 2020
0 parents commit b51d7c8
Show file tree
Hide file tree
Showing 18 changed files with 299 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI

on: push

jobs:

CI:
name: CI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: '14.x'
- run: |
npm i
npm test --if-present
env:
CI: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
package-lock.json
debug.log
13 changes: 13 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
./test
./repl
src
./index.html

.github

./tsconfig.prod.json
./tsconfig.dev.json
./rollup.sever.common.config.js
./rollup.web.common.config.js
./rollup.sever.dev.config.js
./rollup.web.dev.config.js
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Jest expect ordered

Jest, expect one, once and/or ordered.

> Please note that Jest expect ordered is currently under development and not yet suited for production
## Installation

```shell
$ npm i jest-expect-ordered
```

## Usage



```ts
import jestExpectOrdered from "jest-expect-ordered"

jestExpectOrdered()
```

## Contribute

All feedback is appreciated. Create a pull request or write an issue.
7 changes: 7 additions & 0 deletions app/src/jestExpectOrdered.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


export function jestExpectOrdered() {

}

export default jestExpectOrdered
14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Jest expect ordered</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
</head>
<body>
<script>
location.href = "./repl";
</script>
</body>
</html>
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
testEnvironment: "node",
verbose: true,
rootDir: "test/dist"
}
48 changes: 48 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "jest-expect-ordered",
"version": "0.0.1",
"description": "Jest, expect one, once and/or ordered.",
"main": "app/dist/jestExpectOrdered.js",
"types": "app/dist/jestExpectOrdered.d.ts",
"scripts": {
"build": "tsc -p ./tsconfig.prod.json",
"dev": "npm run devNode",
"devWeb": "rollup --config rollup.web.dev.config.js -w",
"devNode": "rollup --config rollup.node.dev.config.js -w",
"deploy": "npm run build && npm publish",
"repl": "node ./repl/dist/jestExpectOrdered-repl.js",
"start": "npm run repl",
"buildTest": "rollup --config rollup.node.test.config.js",
"test": "npm run buildTest && jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/maximilianMairinger/jestExpectOrdered.git"
},
"keywords": [
"jest",
"expect",
"ordered",
"once",
"one"
],
"author": "Maximilian Mairinger",
"license": "ISC",
"bugs": {
"url": "https://github.com/maximilianMairinger/jestExpectOrdered/issues"
},
"homepage": "https://github.com/maximilianMairinger/jestExpectOrdered#readme",
"devDependencies": {
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^8.1.0",
"@rollup/plugin-typescript": "^5.0.0",
"@types/jest": "^26.0.15",
"@types/node": "^13.13.4",
"jest": "^26.6.3",
"rollup": "^2.18.1",
"tslib": "2.0.0",
"typescript": "^4.0.2",
"webpack-merge": "^5.0.9"
}
}
41 changes: 41 additions & 0 deletions repl/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Jest expect ordered - Repl</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<style>
body {
width: 100%;
height: 100vh;
margin: 0;
background: rgb(43, 43, 43);
}
#main {
position: fixed;
width: 100%;
height: 100%;
}
#test {
width: 100px;
height: 100px;
background: blue;
transform: translateY(100px)
}
#scroll {
height: 4000px;
}
</style>
</head>
<body>
<div id="main">
<div id="test"></div>


</div>
<div id="scroll"></div>

<script src='./dist/jestExpectOrdered-repl.js'></script>
</body>
</html>
4 changes: 4 additions & 0 deletions repl/src/repl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import jestExpectOrdered from "../../app/src/jestExpectOrdered"
//const testElem = document.querySelector("#test")

jestExpectOrdered()
22 changes: 22 additions & 0 deletions rollup.node.common.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import typescript from '@rollup/plugin-typescript';
import resolve from '@rollup/plugin-node-resolve';
import commonJS from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'


export default {
input: 'repl/src/repl.ts',
output: {
file: 'repl/dist/jestExpectOrdered-repl.js',
format: 'cjs',
sourcemap: true
},
plugins: [
typescript({tsconfig: "./tsconfig.dev.json", noEmitOnError: false, sourceMap: true}),
resolve({modulesOnly: true, preferBuiltins: true}),
commonJS({
include: 'node_modules/**'
}),
json()
]
};
10 changes: 10 additions & 0 deletions rollup.node.dev.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { merge } from "webpack-merge"
import commonMod from "./rollup.node.common.config"


export default merge(commonMod, {
watch: {
include: ['app/src/**', "repl/src/**"],
exclude: 'node_modules/**'
}
})
11 changes: 11 additions & 0 deletions rollup.node.test.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { merge } from "webpack-merge"
import commonMod from "./rollup.node.common.config"


export default merge(commonMod, {
input: 'test/src/test.ts',
output: {
file: 'test/dist/test.js',
format: 'cjs',
},
})
23 changes: 23 additions & 0 deletions rollup.web.common.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import typescript from '@rollup/plugin-typescript';
import resolve from '@rollup/plugin-node-resolve';
import commonJS from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'


export default {
input: 'repl/src/repl.ts',
output: {
file: 'repl/dist/jestExpectOrdered-repl.js',
format: 'cjs',
sourcemap: true
},
sourcemap: true,
plugins: [
typescript({tsconfig: "./tsconfig.dev.json", noEmitOnError: false, sourceMap: true}),
resolve({browser: true}),
commonJS({
include: 'node_modules/**'
}),
json()
]
};
10 changes: 10 additions & 0 deletions rollup.web.dev.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { merge } from "webpack-merge"
import commonMod from "./rollup.web.common.config"


export default merge(commonMod, {
watch: {
include: ['app/src/**', "repl/src/**"],
exclude: 'node_modules/**'
}
})
11 changes: 11 additions & 0 deletions test/src/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { test } from "shelljs"
import { describe } from "yargs"
import jestExpectOrdered from "../../app/src/jestExpectOrdered"

describe("core", () => {

test("mock", () => {

})

})
11 changes: 11 additions & 0 deletions tsconfig.dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"module": "esnext",
"target": "esnext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"allowJs": true,
"skipLibCheck": true
}
}
20 changes: 20 additions & 0 deletions tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"outDir": "./app/dist",
"module": "esnext",
"target": "esnext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"declaration": true,
"resolveJsonModule": true,
"allowJs": true,
"skipLibCheck": true
},
"exclude": [
"./test",
"./app/dist"
],
"include": [
"./app/src"
]
}

0 comments on commit b51d7c8

Please sign in to comment.