Skip to content

Instantly share code, notes, and snippets.

Tamlyn Rhodes tamlyn

Block or report user

Report or block tamlyn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tamlyn
tamlyn / cypress.test.js
Created Mar 8, 2018
Example Cypress test suite
View cypress.test.js
// a very short Cypress test suite
describe('Admin user', () => {
it('Create posts journey', () => {
const postTitle = 'Hello testing'
cy.get('input[id=title]').type(postTitle)
cy.get('button[title=Create]').click()
cy.get('table tr:last label').should('contain', postTitle)
})
})
@tamlyn
tamlyn / testcafe.test.js
Created Mar 8, 2018
Example TestCafe test suite
View testcafe.test.js
// a very short TestCafe test suite
fixture('Admin user')
test('Create posts journey', t => {
const postTitle = 'Hello testing'
return t
.typeText(ReactSelector('PostCreator FormControl'), postTitle)
.click(ReactSelector('PostCreator Button'))
.expect(ReactSelector('Post').first().find('label').innerText)
.eql(postTitle)
})
@tamlyn
tamlyn / Readme.md
Last active Mar 5, 2018
Redacting fields in GraphQL with Apollo Server
View Readme.md

Demo showing that by specifying a resolver for a scalar property, you can override the value.

This is useful for authorization as it means you can centrally check permissions per field. Your general resolvers can return whole objects without caring about which fields the current user may or may not be allowed to see.

@tamlyn
tamlyn / Readme.md
Created Nov 21, 2017
Slate Editor + Testcafe + WebKit
View Readme.md

Test case

Bug when running Testcafe on Slate Editor inputs in Chrome/Safari

  1. Serve index.html on port 8080, e.g. http-server
  2. Run test, e.g. testcafe chrome test.js

Expected

New text is appended to input

Actual

View keybase.md

Keybase proof

I hereby claim:

  • I am tamlyn on github.
  • I am tamlyn (https://keybase.io/tamlyn) on keybase.
  • I have a public key ASDtLiAyqvI_72LatdxQWOQhNvOLwyMJZtFU0PRAywgROAo

To claim this, I am signing this object:

@tamlyn
tamlyn / pull-modules.sh
Last active Dec 7, 2016
Update and build all npm linked modules
View pull-modules.sh
pull-modules () {
BASE_DIR=$(pwd)
# find symlinks in node_modules
for MODULE in $(find node_modules -type l -depth 1)
do
cd "$MODULE"
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "Updating $MODULE ($BRANCH)..."
@tamlyn
tamlyn / .gitlab-ci.yml
Last active Apr 10, 2016
Dockerised Gitlab+Ci+Runner
View .gitlab-ci.yml
before_script:
- npm install
test:
script: npm test
@tamlyn
tamlyn / README.md
Last active Aug 29, 2015
Warn when Gulp project dependencies need updating
View README.md

How many times have you had this conversation?

"Hey, the project doesn't run on my machine any more."

"Have you tried running npm install?"

...pause...

"Yeah, that fixed it, thanks"

You can’t perform that action at this time.