forked from cognitom/paper-css
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
2 changed files
with
44 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>White</title> | ||
<link rel="stylesheet" href="../paper.css"> | ||
<style>@page { size: A5 landscape }</style> | ||
</head> | ||
|
||
<body class="A5 landscape"> | ||
<section class="sheet padding-20mm"> | ||
|
||
</section> | ||
</body> | ||
|
||
</html> |
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,27 @@ | ||
/* eslint-env mocha */ | ||
import {equal, ok} from 'assert' | ||
import {dirname} from 'path' | ||
import request from 'request-promise-native' | ||
import {readFile} from 'fs-promise' | ||
import findPort from '../lib/find-port' | ||
import startServer from '../lib/server' | ||
|
||
const root = dirname(__dirname) | ||
|
||
describe('paper-cli', function () { | ||
it('finds an available port', async function () { | ||
const port = await findPort() | ||
ok(Number.isInteger(port)) | ||
}) | ||
|
||
it('starts a static server', async function () { | ||
const port = await findPort() | ||
const server = startServer(root, port) | ||
const file = 'test/fixture/white.html' | ||
const url = `http://localhost:${port}/${file}` | ||
const actual = await request(url) | ||
const expected = await readFile(file, 'utf8') | ||
equal(actual, expected) | ||
server.close() | ||
}) | ||
}) |