mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Added Jest snapshot test files as generated src (#3572)
This commit is contained in:
committed by
Colin Seymour
parent
e80b92e407
commit
f38d6bd124
@@ -81,7 +81,8 @@ module Linguist
|
||||
generated_grammarkit? ||
|
||||
generated_roxygen2? ||
|
||||
generated_jison? ||
|
||||
generated_yarn_lock?
|
||||
generated_yarn_lock? ||
|
||||
generated_jest_snapshot?
|
||||
end
|
||||
|
||||
# Internal: Is the blob an Xcode file?
|
||||
@@ -489,5 +490,15 @@ module Linguist
|
||||
return false unless lines.count > 0
|
||||
return lines[0].include?("# THIS IS AN AUTOGENERATED FILE")
|
||||
end
|
||||
|
||||
# Internal: Is this a Jest [snapshot test](https://facebook.github.io/jest/docs/snapshot-testing.html)
|
||||
# file?
|
||||
#
|
||||
# Return true or false.
|
||||
def generated_jest_snapshot?
|
||||
return false unless extname == '.snap'
|
||||
return false unless lines.count > 0
|
||||
return lines[0].start_with?("// Jest Snapshot")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user