This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9f7c49
commit 63d0388
Showing
9 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
makeDOMDriver: () => {}, | ||
h1: () => {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
run: () => {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = () => {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
periodic: () => [], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const {runner} = require('./testRunner'); | ||
|
||
runner({ | ||
dir: 'cyclejs', | ||
name: 'Cyclejs', | ||
}); | ||
|
||
runner({ | ||
dir: 'react-and-favicon', | ||
name: 'React and favicon', | ||
}); | ||
|
||
runner({ | ||
dir: 'react-and-graphql', | ||
name: 'React and GraphQL', | ||
}); | ||
|
||
runner({ | ||
dir: 'react-and-sass', | ||
name: 'React and SCSS', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* eslint-disable no-console */ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const MemoryFS = require('memory-fs'); | ||
const {getConfig} = require('../../getConfig'); | ||
|
||
const runner = ({dir, name, config}) => { | ||
const fs = new MemoryFS(); | ||
|
||
const mocks = path.join(__dirname, '../__mocks__'); | ||
const sample = (p = '') => path.join(__dirname, `../../samples/${dir}`, p); | ||
|
||
const build = (args, cb) => { | ||
const config = getConfig(args); | ||
const compiler = webpack({ | ||
...config, | ||
entry: path.resolve(args.cwd, './src/index'), | ||
resolve: { | ||
...config.resolve, | ||
modules: [mocks] | ||
} | ||
}); | ||
|
||
compiler.outputFileSystem = fs; | ||
|
||
compiler.run((err, stats) => { | ||
if(err) { | ||
throw new Error(err); | ||
} | ||
if(stats.hasErrors()) { | ||
console.log(stats.toString('errors-only')); | ||
} | ||
cb(); | ||
}); | ||
}; | ||
|
||
describe(`${name} sample`, () => { | ||
it('should not crash when building for development', done => { | ||
build({ | ||
env: 'test', | ||
mode: 'development', | ||
cwd: sample(), | ||
config: sample('.webpacker.js'), | ||
...config, | ||
}, done); | ||
}); | ||
}); | ||
}; | ||
|
||
module.exports = { | ||
runner, | ||
}; |