File tree 8 files changed +48
-0
lines changed
8 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "plugins" : [" istanbul" ]
3
+ }
Original file line number Diff line number Diff line change
1
+ # example: unit-tests-js
2
+
3
+ Examples that only run unit tests written using JavaScript
Original file line number Diff line number Diff line change
1
+ {
2
+ "fixturesFolder" : false
3
+ }
Original file line number Diff line number Diff line change
1
+ /// <reference types="cypress" />
2
+ import { isObject , add } from '../../src/utils/misc'
3
+
4
+ describe ( 'unit tests' , ( ) => {
5
+ it ( 'adds two numbers' , ( ) => {
6
+ expect ( add ( 2 , 3 ) ) . to . equal ( 5 )
7
+ } )
8
+
9
+ it ( 'checks for object' , ( ) => {
10
+ expect ( isObject ( { } ) , '{}' ) . to . be . true
11
+ expect ( isObject ( [ ] ) , '[]' ) . to . be . true
12
+ } )
13
+ } )
Original file line number Diff line number Diff line change
1
+ module . exports = ( on , config ) => {
2
+ require ( '../../../../task' ) ( on , config )
3
+ on ( 'file:preprocessor' , require ( '../../../../use-babelrc' ) )
4
+ return config
5
+ }
Original file line number Diff line number Diff line change
1
+ import '../../../../support'
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " example-unit-tests-js" ,
3
+ "description" : " Run unit tests written using JavaScript" ,
4
+ "scripts" : {
5
+ "cy:open" : " ../../node_modules/.bin/cypress open"
6
+ }
7
+ }
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Very simple check, returns true for arrays as well
3
+ */
4
+ export function isObject ( object ) {
5
+ return object != null && typeof object === 'object'
6
+ }
7
+
8
+ /**
9
+ * Adds two numbers together
10
+ * @param {number } a
11
+ * @param {number } b
12
+ */
13
+ export const add = ( a , b ) => a + b
You can’t perform that action at this time.
0 commit comments