Skip to content

Instantly share code, notes, and snippets.

@brian-mann
brian-mann / README.md
Created January 27, 2019 03:38 — forked from kentcdodds/README.md
JavaScript Program Slicing with SliceJS
@brian-mann
brian-mann / README.md
Created January 27, 2019 03:38 — forked from kentcdodds/README.md
slice-js so far...

slice-js

So far...

A talk by @inconshreveable at The Strange Loop 2016 called "Idealized Commit Logs: Code Simplification via Program Slicing" about the amazing tools that can be built with program slicing inspired me to work on this project. Learn more about program slicing here.

This is actual output from slice-js (not yet open source), a program slicing tool that I'm working on right now. I can't wait to work out more kinks, make it more practically useful and show it to you all!

The match-sorter.js file is the transpiled CommonJS version of match-sorter and you can find that here.

/***/ }),
/***/ "2UZ2":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export DropdownModuleNgFactory */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RenderType_Dropdown; });
/* harmony export (immutable) */ __webpack_exports__["b"] = View_Dropdown_0;
/* unused harmony export View_Dropdown_Host_0 */
(Run Starting)
- Browser: Chrome 61
- Browser: Electron 53 (headless)
- Grouping: true (groupId)
- Parallelizing: true (parallelId)
- Run URL: https://dashboard.cypress.io/foo/bar/baz
- Specs Glob: **/*.js -- if used
- Specs Found: 28 (app_spec.coffee, foo_spec.js, bar_spec.js, ...26 more)
@brian-mann
brian-mann / README.md
Created October 18, 2017 17:37
old cypress beautiful WIP
@brian-mann
brian-mann / child.js
Created August 1, 2017 05:06
Fixed timers in electron
process.on('message', (obj = {}) => {
const { id, ms } = obj
setTimeout(() => {
try {
// process.send could throw if
// parent process has already exited
process.send({
id,
ms,
describe('Creating client', () => {
before(() => {
cy.login();
cy.visit('http://xyz/clients')
cy.get('#user-app-navigation li.active')
.get('a');
cy.get('#user-app-navigation li.active a').should('have.attr', 'href')
@brian-mann
brian-mann / custom_command_spec.js
Last active March 20, 2017 18:25
custom command works
Cypress.addParentCommand('getCheckbox', function (labelText) {
return cy.chain().get('label').contains(labelText).find('input[type="checkbox"]')
})
Cypress.addParentCommand("requestUrl", function(url) {
// url = baseUrl + url;
return cy.chain().request(url);
});
it('works', function(){
@brian-mann
brian-mann / iframe.html
Last active September 2, 2016 04:28
cross domain iframes
<html>
<body>
<h2>iframe</h2>
<script type="text/javascript">
setTimeout(function(){
window._e2e_sessionURL = "http://some/url"
}, 1000)
</script>
</body>
</html>
@brian-mann
brian-mann / backend_server.coffee
Created August 31, 2016 16:00
e2e test covering XHR request body + headers
http = require("http")
morgan = require("morgan")
express = require("express")
bodyParser = require("body-parser")
app = express()
srv = http.Server(app)
app.use(morgan("dev"))