This file contains hidden or 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
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
| <title>d3</title> | |
| <script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.2/d3.js" charset="utf-8"></script> | |
| <script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js" charset="utf-8"></script> | |
| <style type="text/css"> |
This file contains hidden or 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
| FROM node:5.12 | |
| ARG phantomjs_version=2.1.1 | |
| RUN mkdir /sdk | |
| WORKDIR /sdk | |
| RUN \ | |
| apt-get update && \ | |
| apt-get upgrade -y && \ |
This file contains hidden or 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
| $ npm install --dev image-diff, jasmine, jasmine-spec-reporter, karma, karma-jasmine, karma-phantomjs-launcher, karma-spec-reporter |
This file contains hidden or 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
| // `name`: The image filename | |
| // `done`: A function provided by jasmine to invoke when we're finished | |
| // rendering | |
| window.renderScreen = function renderScreen(name, done) { | |
| setTimeout(function() { | |
| window.top.callPhantom({ type: 'render', name: name }); | |
| done(); | |
| }, 500); | |
| } |
This file contains hidden or 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
| const path = require('path'); | |
| const karma = require('karma'); | |
| const Server = karma.Server; | |
| const server = new Server({ | |
| configFile: path.join(__dirname, 'render-karma.conf.js') | |
| }, process.exit.bind(process)); | |
| // Make sure dirPath exists and is clean. |
This file contains hidden or 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
| 'use strict'; | |
| module.exports = config => { | |
| config.set({ | |
| basePath: '../../', | |
| frameworks: ['jasmine'], | |
| files: [ |
This file contains hidden or 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
| describe('visual-diff', function() { | |
| it('renders a Button', function(done) { | |
| var button = new Button({ | |
| title: 'Everythings OK Alarm', | |
| subtitle: 'The alarm will make a sound every three seconds', | |
| cost: '$$$$', | |
| cta: 'Order now', | |
| image: '/base/test/assets/homer.jpg' | |
| }); |
This file contains hidden or 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
| const Jasmine = require('jasmine'); | |
| const SpecReporter = require('jasmine-spec-reporter'); | |
| const runner = new Jasmine(); | |
| runner.configureDefaultReporter({ print: function() {} }); | |
| runner.addReporter(new SpecReporter()); | |
| runner.loadConfig({ | |
| spec_dir: 'test/visual-diff', | |
| spec_files: ['diff-test.js'], |
This file contains hidden or 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
| const fs = require('fs'); | |
| const path = require('path'); | |
| const imageDiff = require('image-diff'); | |
| const testCases = fs.readdirSync(path.join('/', 'visual-diff', 'results')); | |
| const expectations = fs.readdirSync(path.join(__dirname, 'expectations')); | |
| const localBasePath = path.join('test', 'visual-diff'); | |
| const dockerBasePath = path.join('/', 'visual-diff'); |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "github.com/hashicorp/hcl" | |
| ) | |
| func main() { | |
| type Template struct { |
OlderNewer